package.src.controllers.forceDirected.spec.ts Maven / Gradle / Ivy
import { registry, PointElement, LinearScale } from 'chart.js';
import createChart from '../__tests__/createChart';
import { ForceDirectedGraphController } from './ForceDirectedGraphController';
import data from './__tests__/miserables';
import { EdgeLine } from '../elements';
import { describe, beforeAll, test } from 'vitest';
describe('dendrogram', () => {
beforeAll(() => {
registry.addControllers(ForceDirectedGraphController);
registry.addElements(EdgeLine, PointElement);
registry.addScales(LinearScale);
});
test('default', () => {
return createChart({
type: ForceDirectedGraphController.id,
data: {
labels: data.nodes.map((d) => d.id),
datasets: [
{
simulation: {
initialIterations: 100,
autoRestart: false,
},
pointBackgroundColor: 'steelblue',
pointRadius: 5,
data: data.nodes,
edges: data.links as any,
},
],
},
}).toMatchImageSnapshot();
});
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy