Skip to content

Commit

Permalink
fix: animation false not work
Browse files Browse the repository at this point in the history
  • Loading branch information
skie1997 committed Jan 3, 2025
1 parent 0cfe45e commit f6b608b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { registerRankingList } from '../../../../src';
import { VChart } from '@visactor/vchart';
import { defaultSpec } from '../../../../src/charts/ranking-list/constant';
import { merge } from '@visactor/vutils';
import { GUI } from 'lil-gui';

const guiObject = {
Expand Down Expand Up @@ -196,7 +194,7 @@ const spec = {

const run = () => {
registerRankingList();
const cs = new VChart(merge(defaultSpec, spec), {
const cs = new VChart(spec, {
dom: document.getElementById('chart') as HTMLElement,
//theme: 'dark',
onError: err => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { registerRankingList } from '../../../../src';
import { VChart } from '@visactor/vchart';
import { defaultSpec } from '../../../../src/charts/ranking-list/constant';
import { merge } from '@visactor/vutils';
import { GUI } from 'lil-gui';

const guiObject = {
Expand Down Expand Up @@ -245,7 +243,7 @@ const spec = {

const run = () => {
registerRankingList();
const cs = new VChart(merge(defaultSpec, spec), {
const cs = new VChart(spec, {
dom: document.getElementById('chart') as HTMLElement,
//theme: 'dark',
onError: err => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { registerRankingList } from '../../../../src';
import { VChart } from '@visactor/vchart';
import { defaultSpec } from '../../../../src/charts/ranking-list/constant';
import { merge } from '@visactor/vutils';
import { GUI } from 'lil-gui';

const guiObject = {
Expand Down Expand Up @@ -176,7 +174,7 @@ const spec = {

const run = () => {
registerRankingList();
const cs = new VChart(merge(defaultSpec, spec), {
const cs = new VChart(spec, {
dom: document.getElementById('chart') as HTMLElement,
//theme: 'dark',
onError: err => {
Expand Down
10 changes: 5 additions & 5 deletions packages/vchart-extension/src/charts/ranking-list/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Datum } from '@visactor/vchart/src/typings';

export const applyVisible = (spec, keyList: string[]) => {
export const applyVisible = (spec: any, keyList: string[]) => {
keyList.forEach(key => {
spec[key] = {
...spec[key],
Expand All @@ -12,15 +12,15 @@ export const applyVisible = (spec, keyList: string[]) => {
});
};

export const mergeObjects = (objA, objB) => {
function recursiveMerge(target, source) {
export const mergeObjects = (objA: any, objB: any) => {
function recursiveMerge(target: any, source: any) {
for (const key in source) {
if (typeof source[key] === 'object' && source[key] !== null) {
if (!target[key]) {
if (!target.hasOwnProperty(key)) {
target[key] = Array.isArray(source[key]) ? [] : {};
}
recursiveMerge(target[key], source[key]);
} else if (!target.hasOwnProperty(key)) {
} else if (!target.hasOwnProperty(key) && typeof target === 'object') {
target[key] = source[key];
}
}
Expand Down

0 comments on commit f6b608b

Please sign in to comment.