Skip to content

Commit

Permalink
Working sunburst, partially treemap, but not network yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Bardadym committed Mar 27, 2021
1 parent e14a062 commit 9dade9b
Show file tree
Hide file tree
Showing 55 changed files with 2,387 additions and 1,655 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
overrides: [
{
files: ["src/**/*.js"],
env: {
commonjs: true,
es6: true,
},
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
},
},
],
};
36 changes: 0 additions & 36 deletions .eslintrc.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ lib/*
node_modules/
stats.*
temp/
dist/
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
24 changes: 12 additions & 12 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
const { rollup } = require("rollup");

const commonJs = require("@rollup/plugin-commonjs");
const postcss = require("rollup-plugin-postcss");
const resolve = require("@rollup/plugin-node-resolve").default;
const typescript = require("@rollup/plugin-typescript");
const postcss = require("rollup-plugin-postcss");
const { terser } = require("rollup-plugin-terser");
const postcssUrl = require("postcss-url");

const TEMPLATE = require("./plugin/template-types");
const TEMPLATE = ["treemap", "sunburst"];

let args = require("yargs")
.strict()
Expand Down Expand Up @@ -61,6 +62,7 @@ const simpleOptions = {

const COMMON_PLUGINS = () =>
[
typescript({ tsconfig: "./src/tsconfig.json", noEmitOnError: true }),
resolve(),
commonJs({
ignoreGlobal: true,
Expand Down Expand Up @@ -89,21 +91,19 @@ const onwarn = (warning, warn) => {
warn(warning);
};

const inputPath = (template) =>
template === "treemap"
? "./src/treemap/index.js"
: `./src/script-${template}.js`;
const inputPath = (template) => `./src/${template}/index.tsx`;

const runBuild = async (template) => {
const inputOptions = {
input: inputPath(template),
plugins: [...COMMON_PLUGINS()],
plugins: [...COMMON_PLUGINS(template)],
onwarn,
};
const outputOptions = {
format: "iife",
file: `./lib/${template}.js`,
file: `./dist/lib/${template}.js`,
name: "drawChart",
exports: "named",
sourcemap: argv.sourcemap,
};

Expand All @@ -121,7 +121,7 @@ const runBuildDev = async (template) => {
input,
plugins: [
...COMMON_PLUGINS(),
require("./")({
require("./dist").default({
title: `test ${template}`,
filename: `stats.${template}${fileExt}`,
template,
Expand Down Expand Up @@ -152,7 +152,7 @@ const runBuildTest_e2e = async (template = "treemap") => {
input,
plugins: [
...COMMON_PLUGINS(),
require("./")({
require("./dist").default({
title: "test e2e",
filename: `stats.e2e${fileExt}`,
template,
Expand Down Expand Up @@ -183,7 +183,7 @@ const runBuildTest_gh59 = async (template) => {
const inputOptions = {
input,
plugins: [
require("./")({
require("./dist").default({
title: "test gh59",
filename: `stats.gh59${fileExt}`,
template,
Expand All @@ -209,7 +209,7 @@ const runBuildTest_gh69 = async (template) => {
const inputOptions = {
input,
plugins: [
require("./")({
require("./dist").default({
title: "test gh69",
filename: `stats.gh69${fileExt}`,
template,
Expand Down
Loading

0 comments on commit 9dade9b

Please sign in to comment.