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

Visualization for multiple line charts #4819

Merged
merged 29 commits into from
May 22, 2018

Conversation

betodealmeida
Copy link
Member

This PR adds a new viz type, line_multi. It's similar to the Deck.gl multi, in that it combines different saved charts (of lines) into a single chart. Here's an example combining two charts, one of them with a group by:

screen shot 2018-04-12 at 6 11 04 pm

screen shot 2018-04-12 at 6 11 12 pm

The viz works by fetching all the data for each chart in parallel (in Javascript), and passing the payload to the nvd3Vis function. Different time series are padded with null at the edges to bypass a bug in multiChart when timeseries have different ranges for x.

One thing I did in this PR was add a sectionOverrides config in visTypes.js, so that the datasource selector is not shown in this viz (I'll add it to the Deck.gl multi in a next PR, or I can do it in this one).

@mistercrunch
Copy link
Member

mistercrunch commented Apr 13, 2018

Neat. I wonder if there is an easy way to align the ticks on both Y axes so they line up. Not a big deal but all those grey lines look a bit chaotic. If you Google image search “dual axis chart” you can see most tools out there align the ticks.

@betodealmeida
Copy link
Member Author

screen shot 2018-04-16 at 12 39 41 pm

@CrystalSun1992
Copy link

which version do u change?

@CrystalSun1992
Copy link

i try to add a new visualization ,echarts_funnel,but it does not display in the types on the front ,my version is 0.24.0 . T.T

@mistercrunch
Copy link
Member

Build is failing :(
Oh also it could be nice to add an example in data/__init__.py this will automatically add test coverage in viz.py as all examples get unit tested.

@betodealmeida
Copy link
Member Author

The build is failing due to conflicting numpy versions, not sure why that's happening. Will take another look, and also add an example.

@betodealmeida
Copy link
Member Author

Added example:

screen shot 2018-04-22 at 11 22 05 am

@betodealmeida
Copy link
Member Author

Will fix unit tests.

@mistercrunch
Copy link
Member

Let's talk about what to do around filters, it may be easy to pass them as extra_filters

@codecov-io
Copy link

codecov-io commented Apr 23, 2018

Codecov Report

Merging #4819 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4819      +/-   ##
==========================================
+ Coverage   77.35%   77.41%   +0.06%     
==========================================
  Files          44       44              
  Lines        8677     8701      +24     
==========================================
+ Hits         6712     6736      +24     
  Misses       1965     1965
Impacted Files Coverage Δ
superset/viz.py 81.7% <100%> (+0.18%) ⬆️
superset/cli.py 44.69% <100%> (+0.62%) ⬆️
superset/data/__init__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce0011e...513ef9c. Read the comment docs.

@betodealmeida
Copy link
Member Author

@mistercrunch, I removed the SQL and filter controls in the last commit. I'll do a separate PR handling them properly, accounting for multiple datasources.

@mistercrunch
Copy link
Member

Cool, please fix merge conflicts, as this looks like it's ready to be merged.

@mistercrunch mistercrunch merged commit 459cb70 into apache:master May 22, 2018
@mistercrunch mistercrunch deleted the DPTOOLS-474_multiple_time_charts branch May 22, 2018 00:47
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections
@anju-jsl
Copy link

@mistercrunch , can you please let me know when this feature will be released?
Thanks

@mistercrunch
Copy link
Member

In 0.26.0, should be cut over the next week or two.

timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections
john-bodley pushed a commit to john-bodley/superset that referenced this pull request Jun 15, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections

(cherry picked from commit 459cb70)
john-bodley pushed a commit to john-bodley/superset that referenced this pull request Jun 19, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections

(cherry picked from commit 459cb70)
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Initial test

* Save

* Working version

* Use since/until from payload

* Option to prefix metric name

* Rename LineMultiLayer to MultiLineViz

* Add more styles

* Explicit nulls

* Add more x controls

* Refactor to reuse nvd3_vis

* Fix x ticks

* Fix spacing

* Fix for druid datasource

* Rename file

* Small fixes and cleanup

* Fix margins

* Add proper thumbnails

* Align yaxis1 and yaxis2 ticks

* Improve code

* Trigger tests

* Move file

* Small fixes plus example

* Fix unit test

* Remove SQL and Filter sections
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants