epiforecasts / RtD3

Rt visualisation in D3
https://epiforecasts.io/RtD3/
Other
6 stars 2 forks source link

Question: Future dev. #9

Closed seabbs closed 3 years ago

seabbs commented 4 years ago

Just thinking aloud.

Do you think adding functionality to the current widget makes the most sense or adding more widgets with different functionality (i.e do you think a massive overall widget as the end goal or a series of widgets that end up containing the same info?).

hamishgibbs commented 3 years ago

Looking at the collection of data that is passed from summaryWidget to rt_vis as x:

https://github.com/epiforecasts/RtD3/blob/1b538597bf48b679ddf8d67f45eee3882283e7d1/inst/htmlwidgets/RtD3.js#L17-L21

The page setup is then handled by setupFlex in rt_vis:

https://github.com/hamishgibbs/rt_vis/blob/ab5d8f380ba5a95670a493fb4a269243c21f4d2a/src/js/rt_vis.ts#L46

Which tries to make something out of whatever it receives (i.e. you give no geoData, you get no map, but other things still render).

Would it be valuable to write functions that give the option to produce a single widget explicitly in RtD3?

I think maybe the system of passing in any selection of datasets to setupFlex and trying to make whatever is possible out of them is a good approach, but maybe more could be done in RtD3 to expose this flexibility explicitly and then just keep rt_vis and summaryWidget the same as more widgets are added.

So then summaryWidget will become the dashboard constructor but RtD3 could also produce quick time series plots in the RStudio viewer, for example (which it already can), or single widgets in an R Markdown document.

Curious to hear your thoughts @seabbs!

hamishgibbs commented 3 years ago

I don't love all of the if statements in setupFlex

hamishgibbs commented 3 years ago

But I guess the interactivity between plots requires that all plots come from the same object when they want to talk to each other

hamishgibbs commented 3 years ago

So maybe focusing on making setupFlex nice and clean and then writing convenience mapWidget and tsWidget and whatever else widget functions in RtD3 would be best

seabbs commented 3 years ago

Functions for underlying functionality: yes I think so.

Passing in anything and getting something: yes I also like this.

"So then summaryWidget will become the dashboard constructor but RtD3 could also produce quick time series plots in the RStudio viewer, for example (which it already can), or single widgets in an R Markdown document." -> seems like a great idea.

Interactivity limitation makes sense and its a major strong point of rolling your own vis as here vs doing something in plotly etc.

For me I really like the idea of providing an expert in a box style visualisation tool that can just be used off the shelf by people. Obviously allowing people to also mix and match makes a lot of sense.

seabbs commented 3 years ago

Closing as discussion.