g6/scripts/demo-to-test/template/test.js
Joel Alan f9b845a9da
chore: add radial layout demo (#5532)
* chore: add radial layout demo

* fix: conversation

* feat: update snapshots

* fix: ci
2024-03-14 19:42:30 +08:00

21 lines
431 B
JavaScript

const testTemplate = ({ config, filename, dataFile }) => {
return `import { Graph } from '@/src';
import data from '@@/dataset/${dataFile}';
import type { STDTestCase } from '../types';
export const ${filename}: STDTestCase = async (context) => {
const graph = new Graph({
...context,
data,
${config}
});
await graph.render();
return graph;
};
`;
};
module.exports = testTemplate;