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: fix issue with external package build error #198

Merged
merged 1 commit into from
Dec 26, 2024
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { CharacterChart } from '@visactor/vstory-core';
import { DYNAMIC_LINE } from './constant';
import type { IDynamicLineChartGraphicAttribute } from './dynamic-line-interface';
import { DynamicLineRuntime } from './dynamic-line-runtime';
import { DynamicLineRuntimeInstance } from './dynamic-line-runtime';

export class DynamicLineCharacter extends CharacterChart<IDynamicLineChartGraphicAttribute> {
static type = DYNAMIC_LINE;

protected _initRuntime(): void {
super._initRuntime();
this._runtime.push(new DynamicLineRuntime(this));
this._runtime.push(DynamicLineRuntimeInstance);
}

getDefaultAttribute(): Partial<IDynamicLineChartGraphicAttribute> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ import type { ICharacterChart } from '@visactor/vstory-core/es/character/chart/i
export class DynamicLineRuntime implements IChartCharacterRuntime {
type = DYNAMIC_LINE;

protected declare _character: ICharacterChart;

constructor(character: ICharacterChart) {
this._character = character;
}

applyConfigToAttribute(): void {
const { bottomRange } = this._character.config.options as any;
const rawAttribute = this._character.getAttribute() as IDynamicLineChartGraphicAttribute;
applyConfigToAttribute(character: ICharacterChart): void {
const rawAttribute = character.getRuntimeConfig().getAttribute() as IDynamicLineChartGraphicAttribute;
const config = character.getRuntimeConfig().config;
const { bottomRange } = config.options as any;
const { spec } = rawAttribute;

const bottom = spec.scrollBar.find((item: any) => item.orient === 'bottom');
Expand Down Expand Up @@ -46,4 +41,4 @@ export class DynamicLineRuntime implements IChartCharacterRuntime {
}
}

export const DynamicLineRuntimeInstance = new DynamicLineRuntime(null);
export const DynamicLineRuntimeInstance = new DynamicLineRuntime();
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class DynamicLinePlayActionProcessor extends VChartBaseActionProcessor {
const { duration, easing } = animation;

const delta = end - start;
(instance.getStage().children[0] as any)
(instance.getStage().getChildren()[0] as any)
.animate()
.to({}, duration, easing)
.onFrame((step: any, t: number) => {
Expand Down
Loading