cosname / recharts

An interface to ECharts
https://recharts.cosx.org
BSD 3-Clause "New" or "Revised" License
337 stars 150 forks source link

eCharts #1

Closed ramnathv closed 8 years ago

ramnathv commented 10 years ago

@yihui @taiyun I am already working on an eCharts integration in rCharts. Let me know if you guys want to work together.

taiyun commented 10 years ago

Wow, that's really nice.

BTW, can you read Chinese? The docs is written in Chinese: http://ecomfe.github.io/echarts/

@kener , some friends are looking forward to seeing en docs :-)

ramnathv commented 10 years ago

@taiyun I can't read Chinese, but fortunately Google can :) http://ecomfe.github.io/echarts/doc/doc.html#Xaxis. Moreover, the code snippets in the examples are in English, so I have been able to piece together the API bit by bit. I can definitely use help from someone who can read Chinese :) so that I don't make incorrect interpretations.

Screenshot

I should have a basic implementation in place in the next week or so. If you want to collaborate, we can discuss other ideas that would expose the full API of eCharts, while keeping the R interface simple and consistent.

Let me know.

taiyun commented 10 years ago

YES. I am very happy to work with you:) Chinese is my native language, if you have some question about echarts docs, just ask me.

BTW, @yummyZhou and I have done some simple work, not elegant but does work. We will add some comments and show it to you in these days. Hope we can work together to write a simple and consistent R interface.

yummyZhou commented 10 years ago

It's amazing to work with all of the guys here, I've developed some interactive plots implemented by d3.js. If there's some jobs that I can make effort, I would be very pleased to.

kener commented 10 years ago

Cool~ Please tell me if I can help and any feedback or suggestion would be welcomed~

ramnathv commented 10 years ago

I am a little tied up this week teaching, but will try to put together all that I have done and push to github sometime next week, so that you guys can help.

taiyun commented 10 years ago

OK. Waiting your great job~

ramnathv commented 10 years ago

As promised, here is some work that I have done

http://rcharts.io/howitworks/echarts/index.html

I modified my layout file based on config.R.

I will be adding more functionality so that it supports the echarts API completely. I would appreciate if any of you want to contribute.

yummyZhou commented 10 years ago

@ramnathv I'm afraid the config.R is an old architecture for implementing echart, and we use the inst/template files to make the code a little clearer. You can just follow the steps to have a check:

require(devtools)
install_github('recharts', 'taiyun')

demo(recharts)  # the demo code for plotting Echarts by launch the localhost
demo(recharts_Local) # the demo code for plotting Echarts to local disk.
demo(recharts_shiny) # the demo code for integrating recharts and shiny.

Also, the new architecture can support user to exports the interactive charts to knitr. The demo file located in inst/demo/recharts_knitr.Rmd

It's fantastic if you can give us some advice to the current architecture or code. :)

ramnathv commented 10 years ago

I have only used the javascript part of config.R in chart.html and it is the same as in inst/template/.

As I indicated in the post, rCharts is a meta-framework that aspires to make it easy for others to hook js libraries into R. Since rCharts automatically handles multiple things including publishing, standalone charts, integration with knitr/slidify/shiny etc, developers can focus on the core aspect of the visualization.

For example, here is an echart published using the publish method in rCharts.

http://rcharts.io/viewer/?7243849

You can include any rChart viz in a knitr/slidify document, either inline or as an iframe. In addition, you can use renderChart and chartOutput to display as Shiny application.

I will be adding more charts to the post over time.

NOTE: I have added a link to your package in my post, in the acknowledgment section.

yummyZhou commented 10 years ago

That's brilliant, so should we have some plan which can add more statistical elements to the current charts/graphs. From my point of view, all of the charts in echarts are so straight that I cannot find anything which can included to statistical graph. In another word, it just make the excel-charts interactively.

So the architecture is an important thing, the integrated of statistical elements and user-interactive charts maybe another important one for using R to generate the interactive plots. Do you have a consider about this issue?

ramnathv commented 10 years ago

Yes absolutely. I think it would be useful to add more functionality to echarts. As I indicated, rCharts does not do anything special, other than providing a simple interface for chart creation and sharing. The nice thing about echarts is that it is completely configuration driven, i.e. a single options payload. So in my mind, the focus should be two fold:

  1. Thinking about options payload that can be used to create interesting statistical charts.
  2. Write R functions that transform user data to this structure.

The ePlot function I wrote is a simple one, which only does very simple processing. But you can write more complex versions which handle statistical computations.

yummyZhou commented 10 years ago

Great, I'll have a try of this brilliant function. And I'll pay more attention to such issue.

:)

ramnathv commented 10 years ago

Let me know if you have any trouble as you try things out. The trickiest part with echarts is the path, which needs to be relative to the html file. So make sure that you are in the right directory before you try things out.