Skip to content

Commit f4d6c92

Browse files
committed
🔧 refactor using lerna and tsdx
1 parent 60ec47c commit f4d6c92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+20173
-9618
lines changed

.babelrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

100755100644
File mode changed.

dist/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/typescript/d3.d.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

dist/typescript/draw-links.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

dist/typescript/index.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/typescript/initializeSVG.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/typescript/link-enter.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/link-exit.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/link-update.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/links/draw-links.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

dist/typescript/links/link-enter.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/links/link-exit.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/links/link-update.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/node-enter.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/typescript/node-exit.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/typescript/nodes/node-enter.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/typescript/nodes/node-exit.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/typescript/nodes/node-update.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/typescript/prepare-data.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/services.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/typescript/typings.d.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

dist/typescript/utils.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

lerna.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "0.0.0"
6+
}

package.json

100755100644
Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,6 @@
11
{
2-
"name": "treeviz",
3-
"version": "2.2.1",
4-
"description": "Library which aims to represent trees for data visualization",
5-
"keywords": [
6-
"d3",
7-
"data",
8-
"visualization",
9-
"tree",
10-
"decision",
11-
"hierarchy",
12-
"dynamic"
13-
],
14-
"repository": {
15-
"type": "git",
16-
"url": "git://github.com/PierreCapo/treeviz.git"
17-
},
18-
"license": "BSD-3-Clause",
19-
"main": "./dist/index.js",
20-
"types": "./dist/typescript/index.d.ts",
21-
"scripts": {
22-
"build": "webpack --mode=production",
23-
"watch": "webpack --mode=development --watch",
24-
"dev": "webpack-dev-server --mode=development",
25-
"test": "jest",
26-
"lint": "tslint src/*.ts"
27-
},
28-
"devDependencies": {
29-
"@babel/core": "^7.6.4",
30-
"@babel/preset-env": "^7.6.3",
31-
"@babel/preset-typescript": "^7.6.0",
32-
"@types/node": "^12.7.12",
33-
"@types/webpack": "^4.39.3",
34-
"@types/webpack-dev-server": "^3.1.7",
35-
"babel-loader": "^8.0.6",
36-
"html-webpack-plugin": "^3.2.0",
37-
"ts-loader": "^6.2.0",
38-
"ts-node": "^8.4.1",
39-
"tslint": "^5.20.0",
40-
"tslint-config-prettier": "^1.18.0",
41-
"typescript": "^3.6.4",
42-
"webpack": "^4.41.1",
43-
"webpack-cli": "^3.3.9",
44-
"webpack-dev-server": "^3.8.2"
45-
},
462
"dependencies": {
47-
"@types/d3-hierarchy": "^1.1.6",
48-
"@types/d3-selection": "^1.4.1",
49-
"@types/d3-transition": "^1.1.4",
50-
"@types/d3-zoom": "^1.7.4",
51-
"d3-hierarchy": "^1.1.8",
52-
"d3-selection": "^1.4.0",
53-
"d3-zoom": "^1.8.3"
54-
}
3+
"lerna": "^3.20.2"
4+
},
5+
"name": "treeviz-root"
556
}

packages/treeviz-react/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/node_modules/**
2+
**/dist/**
3+
**/storybook-static/**
4+
yarn-error.log
5+
.DS_Store
6+
example/.cache
7+
example/dist
8+
node_modules
9+
dist

packages/treeviz-react/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
example
2+
stories
3+
storybook-static
4+
test
5+
node_modules
6+
.DS_Store

packages/treeviz-react/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 PierreCapo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

treeviz-react/README.md renamed to packages/treeviz-react/README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,32 @@ yarn add treeviz-react
2323
```
2424

2525
```js
26-
import React from "react";
27-
import { TreevizReact } from "treeviz-react";
26+
import React from 'react';
27+
import { TreevizReact } from 'treeviz-react';
2828

2929
const data = [
30-
{ id: 1, text_1: "Chaos", text_2: "Void", father: null, color: "#FF5722" },
31-
{ id: 2, text_1: "Tartarus", text_2: "Abyss", father: 1, color: "#FFC107" },
32-
{ id: 3, text_1: "Gaia", text_2: "Earth", father: 1, color: "#8BC34A" },
33-
{ id: 4, text_1: "Eros", text_2: "Desire", father: 1, color: "#00BCD4" }
30+
{ id: 1, text_1: 'Chaos', text_2: 'Void', father: null, color: '#FF5722' },
31+
{ id: 2, text_1: 'Tartarus', text_2: 'Abyss', father: 1, color: '#FFC107' },
32+
{ id: 3, text_1: 'Gaia', text_2: 'Earth', father: 1, color: '#8BC34A' },
33+
{ id: 4, text_1: 'Eros', text_2: 'Desire', father: 1, color: '#00BCD4' },
3434
];
3535

3636
const Foo = () => {
3737
return (
3838
<TreevizReact
3939
data={data}
40-
idKey={"id"}
41-
relationnalField={"father"}
40+
idKey={'id'}
41+
relationnalField={'father'}
4242
nodeWidth={200}
4343
nodeHeight={100}
4444
mainAxisNodeSpacing={2}
4545
secondaryAxisNodeSpacing={1.3}
46-
renderNode={node =>
47-
`<div style="height:${
48-
node.settings.nodeHeight
49-
}px;display:flex;align-items:center;margin-left:12px">Node name: ${
50-
node.data.text_1
51-
}</div>`
46+
renderNode={(node) =>
47+
`<div style="height:${node.settings.nodeHeight}px;display:flex;align-items:center;margin-left:12px">Node name: ${node.data.text_1}</div>`
5248
}
53-
onNodeClick={node => console.log("you clicked on node " + node.id)}
49+
onNodeClick={(node) => console.log('you clicked on node ' + node.id)}
5450
duration={500}
55-
linkWidth={node => 3}
51+
linkWidth={(node) => 3}
5652
/>
5753
);
5854
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.cache
3+
dist
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7+
<title>Playground</title>
8+
<style>
9+
.box {
10+
transition: box-shadow 0.3s;
11+
}
12+
.box:hover {
13+
box-shadow: 0 0 11px rgba(11, 11, 11, 0.4);
14+
}
15+
16+
html {
17+
font-family: Arial;
18+
}
19+
</style>
20+
</head>
21+
22+
<body>
23+
<div id="root"></div>
24+
<script src="./index.tsx"></script>
25+
</body>
26+
</html>

0 commit comments

Comments
 (0)