Skip to content

Conversation

@umairabid
Copy link
Contributor

In the theme files this is passed as root or perhaps the global that might hold the echarts object. However in browser this is undefined and we are actually looking for window. This PR adds a fallback but it does not make the change within the actual function to define consumers this

@umairabid
Copy link
Contributor Author

Fixes #34

factory({}, root.echarts);
}
})(this, function(exports, echarts) {
})(this || window, function(exports, echarts) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to find some a long term solution, because once I'll decide to upgrade JS I need to update it again, and I'm 100% sure I won't do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not following, window should be always there for browsers. Can you give me example where it would fail?

Copy link
Contributor

Choose a reason for hiding this comment

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

if I decide to upgrade eCharts library, I need to make the same changes again

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe I downloaded the wrong theme files? https://echarts.apache.org/en/download.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Theme files look good and I see your point we can't change theme files. The download files seems to be correct. Let me see how import charts load themes, will try to come up with solution that does not depend on changing theme files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@umairabid umairabid closed this Sep 7, 2025
@umairabid
Copy link
Contributor Author

closed by #37

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.

2 participants