Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extras/plugins #3

Open
danielkrizian opened this issue Sep 17, 2014 · 15 comments
Open

Extras/plugins #3

danielkrizian opened this issue Sep 17, 2014 · 15 comments

Comments

@danielkrizian
Copy link
Contributor

Hi,
we have developed couple of specialized extras/plugins to the dygraphs library, such as crosshair, straw-broom/rebase chart type, ribbon, canvas annotations with popup window, candlestick chart with monthly/weekly/daily compression..., see:
https://github.com/danielkrizian/dygraphs/issues?q=is%3Aissue+is%3Aclosed

They have been made available and tested in R through the rChartsDygraphs library.
Would it be possible to merge those features into your project and thus enrich the possibilities?
Thanks!

@jjallaire
Copy link
Member

Yes, absolutely! Hopefully this is something you can give us a pull request for. Perhaps before the PR we could discuss what you envision the API for the extra features would be (i.e. would it be new functions or the addition of options/parameters to existing functions).

@danielkrizian
Copy link
Contributor Author

I was thinking about this. Extra features are mostly implemented as dygraphs plugins. Let's take first extra as an example:

Floating legend: it follows the highlighted points

This extra, as well as others mentioned above, requires different version of dygraph-combined.js (where the new plugins are minified), as well as adjustment to the existing dyLegend function:

dygraph(nhtemp, main = "New Haven Temperatures") %>% 
   dyLegend(show = "follow")

I would say the API would be a combination of new functions (e.g. %>% dyRibbon()), new options to existing functions (e.g. dyOptions(plotter="#!Dygraph.Plotters.candlePlotter!#") and ability to point to and src from custom, non-default dygraph-combined.js file.
But I can be easily persuaded, as there are certainly more experienced JS folks than me (the JS part was written by @pshevtsov)

@jjallaire
Copy link
Member

Agree 100% with your thoughts on how to extend the API (combination of adding options to existing functions + some new functions e.g. dyRibbon).

In terms of the changes to dygraphs-combined.js, I'd like to keep us as much as possible in sync with the master of dygraphs (to get bug fixes, new features, etc.). There are two clean ways I can think of to do this:

(1) Submit our changes as pull requests to dygraphs; or

(2) Create another htmlwidget dependency which includes our plugins (note that it's not critical IMHO that these be minified or physically part of dygraphs-combined.js). Is there a way to include plugins without regenerating dygraphs-combined.js

Realize that both of the above could be impractical depending on receptivity to pull requests and how dygraphs is composed/deployed. In that case I'd want to make sure that our forked copy of dygraphs easily accepts upstream merges without manual resolution with every sync.

You know the territory better than I do though, let me know what you think the best course is.

@eddelbuettel
Copy link

Has anything happened on this front?

Daniel's extensions seem useful now that I am in the htmlwidgets and dygraphs camp...

@przmv
Copy link
Collaborator

przmv commented Mar 16, 2015

Hello Dirk! Thanks for your interest!

We are currently working on committing the extra functionality to the
dygraph's upstream, so we won't have to support both — main library and
fork with extras. This is not so fast process for some reasons, but we are
working hard to succeed.

Cheers!

On Mon, Mar 16, 2015 at 8:23 PM, Dirk Eddelbuettel <[email protected]

wrote:

Has anything happened on this front?

Daniel's extensions seem useful now that I am in the htmlwidgets and
dygraphs camp...


Reply to this email directly or view it on GitHub
#3 (comment).

Petr Shevtsov

@danielkrizian
Copy link
Contributor Author

👍 @pshevtsov ! Great to have you Dirk @eddelbuettel in the dygraphs camp, which is obviously better than highcharts/highstock camp :P

@eddelbuettel
Copy link

💯 Awesomeness!

@timelyportfolio
Copy link
Contributor

any updates?

@danielkrizian
Copy link
Contributor Author

If I'm not mistaken (credit to @pshevtsov & @danvk ):

  1. Crosshair implemented in JavaScript (Crosshair danvk/dygraphs#299) - needs to be ported to rstudio/dygraphs
  2. Rebase (Straw broom) implemented in JS (Rebase (Straw broom) Plugin danvk/dygraphs#540) - needs to be ported to rstudio/dygraphs
  3. Colored ribbon waiting to be pulled: Plugin: Colored ribbon danvk/dygraphs#537
  4. Candlestick plotter waiting to be pulled: Candlestick plotter danvk/dygraphs#538
  5. Canvas annotations (example: trade arrows with pop-ups) plugin under development (part of SuperAnnotations plugin, needs to be debugged Adding xOptView for xfv.call to work properly danvk/dygraphs#628)

@jjallaire
Copy link
Member

One issue related to porting to rstudio/dygraphs is that these rely on
dygraphs 1.1. I've attempted to upgrade to dygraphs 1.1 however this breaks
a bunch of the custom axis formatting we do as part of useDataTimezone
(i.e. use of moment.js). I don't have time to run all of these issues down
so I've held off on dygraphs 1.1.

I'd certainly be grateful for a pull request that does the update to
dygraphs 1.1 and at the same time ensures that all axis labels are visible
and coherent (i.e. not clipped as I've seen them when just doing a straight
import of dygraphs 1.1).

On Tue, Jul 28, 2015 at 3:01 PM, Daniel Krizian [email protected]
wrote:

If I'm not mistaken (credit to @pshevtsov https://github.com/pshevtsov
& @danvk https://github.com/danvk ):

  1. Crosshair implemented in JavaScript (Crosshair danvk/dygraphs#299
    Crosshair danvk/dygraphs#299) - needs to be ported to
    rstudio/dygraphs
  2. Rebase (Straw broom) implemented in JS (Rebase (Straw broom) Plugin danvk/dygraphs#540
    Rebase (Straw broom) Plugin danvk/dygraphs#540) - needs to be ported to
    rstudio/dygraphs
  3. Colored ribbon waiting to be pulled: Plugin: Colored ribbon danvk/dygraphs#537
    Plugin: Colored ribbon danvk/dygraphs#537
  4. Candlestick plotter waiting to be pulled: Candlestick plotter danvk/dygraphs#538
    Candlestick plotter danvk/dygraphs#538
  5. Canvas annotations (example: trade arrows with pop-ups
    http://rawgit.com/danielkrizian/dygraphs/master/tests/canvas-annotation.html)
    plugin under development (part of SuperAnnotations plugin, needs to be
    debugged Adding xOptView for xfv.call to work properly danvk/dygraphs#628
    Adding xOptView for xfv.call to work properly danvk/dygraphs#628)


Reply to this email directly or view it on GitHub
#3 (comment).

@chrisirhc
Copy link

I commented on #30, but I think the discussion should be here instead.
Instead of modifying formatter. Perhaps instead, this project should use the axisLabelWidth and pixelsPerLabel options (as mentioned in danvk/dygraphs#639) after updating to dygraphs 1.1 ?

@jjallaire
Copy link
Member

Now that we've updated to dygraphs 1.1 we can take these into the dygraphs package. Happy to entertain a pull request for this!

@eddelbuettel
Copy link

I saw the CRAN upload via CRANberries but have not had time to play...

@przmv
Copy link
Collaborator

przmv commented Jan 25, 2016

Hello!

Unfortunately, there is no reply from @danvk about our two pull requests danvk/dygraphs/pull/537 and danvk/dygraphs/pull/538

Probably, to make things go faster, it's better to implement these extras in this repo codebase, the same way as a stemPlotter was implemented (https://github.com/rstudio/dygraphs/blob/master/R/series.R#L234)?

One more note. The combined dygraph.js contains only the core functionality without any extras from https://github.com/danvk/dygraphs/tree/master/src/extras

BTW, I've just implemented candlestick charts (without periods compression for now)

screenshot from 2016-01-25 04 05 49

@jjallaire
Copy link
Member

Hi Petr,

I'd be happy to entertain a pull request with your new functionality (as
well as the right recipe for getting the dygraphs extras include if that's
desirable).

J.J.

On Sun, Jan 24, 2016 at 8:10 PM, Petr Shevtsov [email protected]
wrote:

Hello!

Unfortunately, there is no reply from @danvk https://github.com/danvk
about our two pull requests danvk/dygraphs#537
danvk/dygraphs#537 and danvk/dygraphs#538
danvk/dygraphs#538

Probably, to make things go faster, it's better to implement these extras
in this repo codebase, the same way as a stemPlotter was implemented (
https://github.com/rstudio/dygraphs/blob/master/R/series.R#L234)?

One more note. The combined dygraph.js contains only the core
functionality without any extras from
https://github.com/danvk/dygraphs/tree/master/src/extras

BTW, I've just implemented candlestick charts (without periods compression
for now)

[image: screenshot from 2016-01-25 04 05 49]
https://cloud.githubusercontent.com/assets/290451/12540392/5b32ac02-c319-11e5-8f48-966bc3b0d86f.png


Reply to this email directly or view it on GitHub
#3 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants