https://kotlinlang.org logo
Join SlackCommunities
Powered by
# data2viz
  • m

    molikto

    05/04/2020, 9:40 AM
    will see if I can make it work...
    👍 2
  • m

    molikto

    05/04/2020, 9:43 AM
    It seems the code is very well organized, and porting should be easy!
    j
    • 2
    • 1
  • m

    molikto

    05/05/2020, 4:30 AM
    hello. I see there are touch event related code, is it exposed as part of the Viz DSL?
    g
    • 2
    • 1
  • b

    Bruno_

    07/10/2020, 4:04 PM
    hey, I want to extend the data2viz dsl but that's not possible due to hardcoded renderable types https://github.com/data2viz/data2viz/blob/aad3ce13c12d472d208ad5261d367a390b5d4076/viz/src/jfxMain/kotlin/io/data2viz/viz/JfxGroupRenderer.kt#L51
    Copy code
    if (node.visible)
    			when (node) {
    				is CircleNode       -> node.render(gc)
    				is RectNode         -> node.render(gc)
    				is GroupNode        -> node.render(gc)
    				is PathNode     	-> node.render(gc)
    				is TextNode         -> node.render(gc)
    				is LineNode         -> node.render(gc)
    				else            -> error("Unknow type ${node::class}")
    			}
    what do you think about making a
    Renderable
    interface which every node type would implement?
    Copy code
    class RectNode(rect: Rect = RectGeom()) : Node(),
            Rect by rect,
            HasFill,
            HasStroke,
            Renderable {
        override fun render(gc: GraphicsContext) {...}
    }
    or alternatively make a
    RectRenderable
    interface
  • b

    Bruno_

    07/10/2020, 4:06 PM
    I'd be glad to make such contribution, it's just I don't want to work on something that will be then rejected
  • b

    Bruno_

    07/10/2020, 4:08 PM
    so my question is: if I were to implement it would you accept the PR?
  • g

    gaetan

    07/10/2020, 4:29 PM
    Hello @Bruno_ Thank you for your interest and your proposal. The idea of the basic visual elements (rectangle, circle, line, path) is that they have no binding to any rendering context. It is then the responsibility of a specific platform renderer to transform this “in memory” element into graphics. Can you explain in what way you would like to extend the DSL, what do you need that is not currently possible?
  • b

    Bruno_

    07/10/2020, 4:40 PM
    I wanted to make a
    Candle
    (pic rel) extension, what I want to do is technically possible by composing two rectangles (or rectangle + path) and I thought that it would be nicer to create a CandleNode etc
  • g

    gaetan

    07/10/2020, 4:48 PM
    This is typically something you can do by adding an extension to Group for example.
    fun Group.candle(width: Double, height …) {
    line{...}
    rect {...}
    }
    It will then be usable out of the box on Kotlin/JS JFx, Android.
    👍 1
  • n

    Nikky

    12/07/2020, 7:21 PM
    hi, is jetbrains compose for desktop a target ? #compose-desktop
    g
    • 2
    • 1
  • s

    steamstreet

    12/15/2020, 8:19 PM
    What is the status of charts-kt? It looks like it’s somewhat ready to be used but I don’t see any info about how to use it?
    • 1
    • 2
  • s

    steamstreet

    12/15/2020, 8:20 PM
    We’d be interested in using it in our react browser application.
  • g

    gaetan

    12/17/2020, 2:21 PM
    Hello Jon, We have been working a lot these last months on Charts-kt and the current version (0.8.4) provides a nice DSL to make the chart creation a breeze. You can see some online samples here: • Basic Scatter Plot • Basic Line chart • Basic Column chart • Basic Bar chart • Stacked Column chart • Multi-series scatter plot We are currently working on the first version of the documentation. We also deployed the API reference documentation (Dokka). We’re planning to publish the v1.0 on the first quarter of 2021. Regarding the platforms, Charts-kt is currently working on JavaFX and inside the browser. It should be quite easy to make the first Android version. Other platforms will depend on our work on the base data2viz project. We would be very much interested in knowing your use case, type of application, platform, ...
  • m

    mbonnin

    03/15/2021, 10:43 AM
    Hi 👋 Is it possible to build a Tree representation with data2viz? Looking at the source, it looks like
    TreeLayout
    is what I want to use to position my nodes. I guess I'll have to do the drawing myself? Is there anything in the library to draw connectors ?
    p
    g
    • 3
    • 6
  • p

    pmariac

    03/15/2021, 2:26 PM
    Hello Martin, that's right, you should use TreeLayout to build your tree, then iterate over your nodes to draw basic shapes. If you want some Bézier curves, the LinkBuilder in the io.data2viz.shape module is what you're looking for.
  • p

    pmariac

    03/15/2021, 2:26 PM
    Check this sketch for example : https://play.data2viz.io/sketches/wJwZBY/view/
    😍 1
  • b

    Bryson Prince

    07/05/2021, 5:14 PM
    Hi I'm trying to get a student license to use charts.kt, anyone know who I should talk to about that?
  • p

    pmariac

    07/06/2021, 10:43 AM
    Hi @Bryson Prince, please create an account on our forum https://forum.data2viz.io/ an ping me, we'll send you all the requirements,n and thanks for your interest in charts.kt ! 🙂
  • s

    SrSouza

    12/01/2021, 1:23 AM
    HI folks, there is any plan to make a version of data2viz in Compose?
    g
    • 2
    • 1
  • h

    holgerbrandl

    12/14/2021, 9:44 PM
    Is there a way to use charts.kt in an opensource project?
    👀 2
    g
    • 2
    • 5
  • s

    Sebastian Schuberth

    01/02/2023, 7:08 AM
    Happy New Year everyone! I realized that https://www.data2viz.io/ is down, and there have been no updates in here for a long time. Is this project dead?
  • g

    gaetan

    01/02/2023, 8:46 AM
    Hello @Sebastian Schuberth, Thanks for the alert. The project is not dead and Charts.kt (based on the data2viz library) is used in production. We’ll update our roadmap in the future weeks.
    s
    • 2
    • 3
  • g

    gaetan

    01/02/2023, 9:03 AM
    @Sebastian Schuberth The correct URL is https://data2viz.io/. From where did you get the WWW.data2viz.io url? I need to add a redirect.
    s
    • 2
    • 2
  • s

    Sebastian Schuberth

    01/04/2023, 4:22 PM
    Hello again, are there any plans to bring data2viz / charts-kt to compose (for desktop)?
  • g

    gaetan

    01/04/2023, 4:33 PM
    Hello @Sebastian Schuberth Yes, it’s in the plans. @louiscad is going to work on it. What is your use case?
    👍 1
    s
    c
    • 3
    • 2
  • d

    Dominik

    02/22/2023, 10:31 AM
    Hi, we are interested in using data2viz for a commercial project to generate some nice looking graphs 😉 I would have following questions: • do you have more information about the OEM licensing model (we have more than one developer, but we would generate the graphs on our backends not in apps) • would it be possible to get some test licenses so we could evaluate if the integration for backend generated charts would work for us Thanks
    g
    p
    • 3
    • 10
  • j

    Joffrey

    09/13/2023, 7:08 PM
    Hi folks! Trying out charts.kt for the first time. Is there any way to customize the order of the series in a stack? I'm using an area chart with standard stacking, but no matter how I define the series, I don't manage to put the one I want below the other.
  • p

    pmariac

    09/14/2023, 8:15 AM
    Hi @Joffrey the order of the series is simply the order of the given items in your list, check this very simple example: https://play.data2viz.io/sketches/XYNkyJ/edit/, if you change the way
    SplitProfit
    are mapped, then the series will be drawn in a different order.
    j
    • 2
    • 11
  • p

    pmariac

    09/14/2023, 8:16 AM
    If you have any trouble, just paste your charts code here and I'll have a look.
  • j

    Joffrey

    09/14/2023, 11:53 AM
    Since you seem open to feedback, there is something else I'd like to share. I noticed I could use parts of the charts DSL in nested places that don't make much sense. For instance, I can write the following nonsense and the compiler is happy:
    Copy code
    chart(data = props.simulation.monthlyPayments.seriesBreakdown()) {
        title = "Monthly payments (${props.simulation.name})"
    
        config {
            config {
                config {
                    val time = discrete({ domain.month }) { name = "Time" }
                    val value = quantitative({ domain.amount }) { name = "Amount" }
                    area(time, value)
                }
            }
            events {
                config {
                    selection {
                        series = discrete({ domain.type })
                        zoom {
                            selectionMode = SelectionMode.Disabled
                        }
                    }
                    zoomMode = ZoomMode.X
                }
            }
        }
    }
    This could be prevented by creating an annotation to mark the charts DSL using `@DslMarker`: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-dsl-marker/
    p
    • 2
    • 2