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

Make d3 internal and stop exporting d3-v3 to the API #5400

Merged
merged 5 commits into from
Jan 14, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jan 13, 2021

Addressing #5395.

Please note that considering the changes made in src/core.js, d3-v3 functions e.g. csv & json won't be available via Plotly.d3.

That would help splitting and upgrading d3 sub packages in future possible.
cc: #424.

Also to mention,
The strict-d3 is moved from test/image/strict-d3.js to src/lib/d3.js and the browserify transform is simplified.
update: strict-d3 is moved to test and applied in all the jasmine tests.

See c71d689

@plotly/plotly_js
cc: @rreusser

@archmoj archmoj added this to the NEXT milestone Jan 13, 2021
@alexcjohnson
Copy link
Collaborator

The reason strict-d3 was a transform before is that we only wanted to use it in testing and dev environments, not in production code, because it has a performance penalty. I don't know how much, but can we keep it out of prod builds?

@archmoj
Copy link
Contributor Author

archmoj commented Jan 14, 2021

The reason strict-d3 was a transform before is that we only wanted to use it in testing and dev environments, not in production code, because it has a performance penalty. I don't know how much, but can we keep it out of prod builds?

Sure. Do you think that we should still keep strict-d3 around now that IE9 and IE10 are neither supported nor used in development?

@alexcjohnson
Copy link
Collaborator

Yes, strict-d3 still has checks that apply to modern browsers - either things different browsers don't agree on, or usage edge cases like style as a getter on unattached elements.

 - use strictD3 in jasmine tests
 - add strict d3 path to constants
 - flat domain_ref assets
@archmoj
Copy link
Contributor Author

archmoj commented Jan 14, 2021

Yes, strict-d3 still has checks that apply to modern browsers - either things different browsers don't agree on, or usage edge cases like style as a getter on unattached elements.

Thanks for the info.
Please see c71d689 for the changes made in this PR.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@archmoj archmoj merged commit af9d440 into master Jan 14, 2021
@archmoj archmoj deleted the make-d3-v3-internal branch January 14, 2021 15:12
@jxu
Copy link

jxu commented Jun 25, 2021

So this is why I got Uncaught (in promise) TypeError: Plotly.d3 is undefined when using 2.0.0

@RichardNeill
Copy link

This breaks the ability to do:
var d3colors = Plotly.d3.scale.category10();
as recommended, here: https://stackoverflow.com/questions/40673490/how-to-get-plotly-js-default-colors-list
What is the new "approved" way of getting the color list? Thanks.

@nicolaskruchten
Copy link
Contributor

You'll need to import d3 separately if you want to call d3 functions :)

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

Successfully merging this pull request may close these issues.

5 participants