ECharts.jl icon indicating copy to clipboard operation
ECharts.jl copied to clipboard

Add chart types

Open randyzwitch opened this issue 7 years ago • 5 comments
trafficstars

Completed:

  • [x] sunburst http://echarts.baidu.com/examples/editor.html?c=sunburst-simple
  • [x] tree http://echarts.baidu.com/examples/editor.html?c=tree-basic
  • [x] treemap http://echarts.baidu.com/examples/editor.html?c=treemap-simple

To do:

  • [ ] force-directed graph http://echarts.baidu.com/examples/editor.html?c=graph-force
  • [ ] arc diagram
  • [ ] maps (bubbles on map, choropleths, etc.)
  • [ ] bullet graph
  • [ ] calendar http://echarts.baidu.com/examples/editor.html?c=calendar-horizontal
  • [ ] chord diagram
  • [ ] circle-packing http://gallery.echartsjs.com/editor.html?c=xHyzR8UUNb
  • [ ] gantt
  • [ ] OHLC http://echarts.baidu.com/examples/editor.html?c=custom-ohlc
  • [ ] parallel coordinates http://echarts.baidu.com/examples/editor.html?c=parallel-simple
  • [ ] population pyramid http://gallery.echartsjs.com/editor.html?c=xS1zMjXe2x
  • [ ] radial column chart
  • [ ] span chart
  • [ ] spiral plot
  • [ ] stem and leaf
  • [ ] venn diagram
  • [ ] violin plot
  • [ ] wordcloud http://gallery.echartsjs.com/editor.html?c=xBkVAKkIle
  • [ ] marimekko chart http://echarts.baidu.com/examples/editor.html?c=custom-profit
  • [ ] punch card http://echarts.baidu.com/examples/editor.html?c=scatter-punchCard
  • [ ] ridgeline plot (joy plot)
  • [ ] beeswarm
  • [ ] single axis
  • [ ] faceted charts http://echarts.baidu.com/examples/editor.html?c=scatter-matrix
  • [ ] horizon plot

randyzwitch avatar Mar 09 '18 21:03 randyzwitch

Is there some documentation to get up to speed with this? I would be happy to add a few of these, if I can.

braamvandyk avatar Oct 15 '19 09:10 braamvandyk

Thanks for checking out ECharts! I haven't written any contributing docs yet, so I should probably do that. But in general, I've taken a very different approach than most other plotting packages in Julia.

First, I have intentionally not implemented the plot recipes style, because I find it confusing and also switching backends isn't interesting to me. Secondly, my API style is much more opinionated about what the minimum number of arguments for any can be and what the default arguments should be. You'll notice that for each function, the minimum arguments are just the data arguments; stylistic arguments are keywords with defaults. Finally, my style is to view visualizations as iterations, where you're applying operations to the chart. That's why all the style functions have the exclamation point; they take a pre-existing chart and modify it somehow.

If there's a specific chart you are interested in first, I'd be happy to work with you to get it implemented, so that you can get the feel of this library. The way I started was to get the working JSON from the echarts website, then work to generate that same JSON using Julia structs. You can either render the chart to see if it gives you what you want or call print(x::EChart) and the JSON will be printed to the console.

randyzwitch avatar Oct 16 '19 00:10 randyzwitch

Thanks. How about starting with graphs? It's not on the list, but it's what I was looking for when I found ECharts in the first place.

braamvandyk avatar Oct 16 '19 21:10 braamvandyk

Graphs like these? https://echarts.baidu.com/examples/editor.html?c=graph-force

Regardless of where you start, I think the area.jl shows the style I've gone for:

https://github.com/randyzwitch/ECharts.jl/blob/master/src/plots/area.jl

Here, you'll see that I define methods for arrays first, then dataframes (which can be thought of as lists of lists), then the KernelDensity.UnivariateKDE function signature. What I've found is that multiple dispatch tends to make it really easy to work this way; defining your methods in terms of a Julia standard type, then decomposing the compound types fields into calling the same method with the Julia standard types.

Ultimately, I'm not going to be a stickler at this point about how you implement this, because more chart types is better than arguing about syntax! When you get even a rough draft going, open a PR and I'll take a look

randyzwitch avatar Oct 17 '19 15:10 randyzwitch

Right, well let me see what I can manage. Will get back with either a result or a cry for help ASAP.

braamvandyk avatar Oct 20 '19 13:10 braamvandyk