Repository navigation
fix: accept every echarts init option in the opts type - #632
Open
Sam-Razavi wants to merge 1 commit into
Open
Sam-Razavi wants to merge 1 commit into
Sam-Razavi wants to merge 1 commit into
Conversation
Opts was missing useDirtyRect, useCoarsePointer, pointerSize and ssr, and only allowed numbers or 'auto' for width/height and a string for locale, so valid echarts.init options failed to type check. The component already passes opts straight to echarts.init, so this is a type-only change. Add a test that renders with every init option. Fixes hustcc#567
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #567
optsis passed straight toecharts.init, but its type was missinguseDirtyRect,useCoarsePointer,pointerSizeandssr. It also only allowed a number or'auto'forwidth/height(so'400px'failed) and a string forlocale. This brings it in line with ECharts'EChartsInitOpts. It's type-only, with no runtime change.Checked with
tscagainst a small consumer file: the new options, string sizes and a value typed as ECharts' ownEChartsInitOptsall failed to type check before and pass now.width: 'auto'andheight: nullstill work.The added test renders a chart with every init option and checks that the renderer and string sizes reach the instance. It passes on
mastertoo, since the options already worked at runtime. It's there to cover the full set going forward.This doesn't add server-side rendering itself (the "SSR support" part of the issue). It only lets
ssrbe passed without a type error.