Skip to content

Commit

Permalink
feat(lib): change graphlib and plotlib (#5484)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini authored Aug 30, 2023
1 parent c0c5746 commit ad175a0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
8 changes: 7 additions & 1 deletion __tests__/unit/lib/graph.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { graphlib } from '../../../src/lib';
import { ForceGraph, Tree } from '../../../src/mark';
import { ForceGraph, Tree, Sankey, Treemap, Pack } from '../../../src/mark';
import { Cluster, Arc } from '../../../src/data';

describe('graphlib', () => {
it('graphlib() should returns expected graph components.', () => {
expect(graphlib()).toEqual({
'data.cluster': Cluster,
'data.arc': Arc,
'mark.forceGraph': ForceGraph,
'mark.tree': Tree,
'mark.sankey': Sankey,
'mark.treemap': Treemap,
'mark.pack': Pack,
});
});
});
16 changes: 2 additions & 14 deletions __tests__/unit/lib/plot.spec.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import { plotlib } from '../../../src/lib';
import {
Sankey,
Treemap,
Pack,
Boxplot,
WordCloud,
Gauge,
} from '../../../src/mark';
import { Venn, Cluster, Arc } from '../../../src/data';
import { Boxplot, WordCloud, Gauge } from '../../../src/mark';
import { Venn } from '../../../src/data';

describe('plotlib', () => {
it('plotlib() should returns expected plot components.', () => {
expect(plotlib()).toEqual({
'data.venn': Venn,
'data.cluster': Cluster,
'data.arc': Arc,
'mark.sankey': Sankey,
'mark.treemap': Treemap,
'mark.pack': Pack,
'mark.boxplot': Boxplot,
'mark.wordCloud': WordCloud,
'mark.gauge': Gauge,
Expand Down
8 changes: 7 additions & 1 deletion src/lib/graph.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ForceGraph, Tree } from '../mark';
import { Sankey, Treemap, Pack, ForceGraph, Tree } from '../mark';
import { Arc, Cluster } from '../data';

export function graphlib() {
return {
'data.arc': Arc,
'data.cluster': Cluster,
'mark.forceGraph': ForceGraph,
'mark.tree': Tree,
'mark.pack': Pack,
'mark.sankey': Sankey,
'mark.treemap': Treemap,
} as const;
}
9 changes: 2 additions & 7 deletions src/lib/plot.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { Sankey, Treemap, Pack, Boxplot, WordCloud, Gauge } from '../mark';
import { Arc, Cluster, Venn } from '../data';
import { Boxplot, WordCloud, Gauge } from '../mark';
import { Venn } from '../data';

export function plotlib() {
return {
'data.venn': Venn,
'data.arc': Arc,
'data.cluster': Cluster,
'mark.sankey': Sankey,
'mark.treemap': Treemap,
'mark.boxplot': Boxplot,
'mark.pack': Pack,
'mark.gauge': Gauge,
'mark.wordCloud': WordCloud,
} as const;
Expand Down

0 comments on commit ad175a0

Please sign in to comment.