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

fix(ssr): fix label doesn't show in line series when ssr is enabled #18032

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/chart/line/LineView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class LineView extends ChartView {

const lineGroup = this._lineGroup;

const hasAnimation = seriesModel.get('animation');
const hasAnimation = !ecModel.ssr && seriesModel.isAnimationEnabled();
Copy link
Contributor

Choose a reason for hiding this comment

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

seriesModel.isAnimationEnabled should have considerd ecModel.ssr

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Understand, we tried to fix the issue by disabling the animation in SSR mode.


const isAreaChart = !areaStyleModel.isEmpty();

Expand Down Expand Up @@ -1085,10 +1085,10 @@ class LineView extends ChartView {
if (zrUtil.isFunction(seriesDuration)) {
seriesDuration = seriesDuration(null);
}
const seriesDalay = seriesModel.get('animationDelay') || 0;
const seriesDalayValue = zrUtil.isFunction(seriesDalay)
? seriesDalay(null)
: seriesDalay;
const seriesDelay = seriesModel.get('animationDelay') || 0;
const seriesDelayValue = zrUtil.isFunction(seriesDelay)
? seriesDelay(null)
: seriesDelay;

data.eachItemGraphicEl(function (symbol: SymbolExtended, idx) {
const el = symbol;
Expand Down Expand Up @@ -1131,8 +1131,8 @@ class LineView extends ChartView {
ratio = 1 - ratio;
}

const delay = zrUtil.isFunction(seriesDalay) ? seriesDalay(idx)
: (seriesDuration * ratio) + seriesDalayValue;
const delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx)
: (seriesDuration * ratio) + seriesDelayValue;

const symbolPath = el.getSymbolPath();
const text = symbolPath.getTextContent();
Expand Down
1 change: 1 addition & 0 deletions test/runTest/actions/__meta__.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/svg-ssr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 122 additions & 0 deletions test/svg-ssr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.