Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Unsupport web feature #158

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/generate-doc-and-deploy.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .storybook/config.js

This file was deleted.

19 changes: 0 additions & 19 deletions .storybook/main.js

This file was deleted.

4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.exclude": ["**/dist/**", "**/node_modules/**"],
"markdownlint.config": {
"default": true,
"MD041": false
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"deno.enable": false
}
39 changes: 1 addition & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ $ npm install @ts-graphviz/react

```bash
# Peer Dependencies
$ yarn add react react-dom ts-graphviz@"^0.12.0"
# Optional Peer Dependencies
$ yarn add @hpcc-js/wasm
$ yarn add react react-dom ts-graphviz@"^0.13.1"
```

## DEMO

- [Storybook](https://ts-graphviz.github.io/react/)

## API

### Script
Expand Down Expand Up @@ -111,37 +105,6 @@ digraph {

![dot](./example/example.svg)

### Web

The `Graphviz` component can be rendered directly in the browser.

Since this component uses the function of `@hpcc-js/wasm` internally, it is necessary to host `@hpcc-js/wasm/dist/graphviz.wasm` and specify its directory with `wasmFolder`.

For development, I recommend using the one hosted by unpkg.

```tsx
import React, { FC } from 'react';
import ReactDOM from 'react-dom';
import { Graphviz, Digraph, Node, Edge } from '@ts-graphviz/react';
import { wasmFolder } from '@hpcc-js/wasm';

wasmFolder('https://unpkg.com/@hpcc-js/wasm/dist/');

const App: FC = () => (
<Graphviz>
<Digraph>
<Node id="n1" />
<Node id="n2" />
<Node id="n3" />
<Edge targets={['n1', 'n2', 'n3']} />
<Edge targets={['n1', 'n3']} />
</Digraph>
</Graphviz>
);

ReactDOM.render(<App />, document.getElementById('root'));
```

## See Also

Graphviz-dot Test and Integration
Expand Down
14 changes: 1 addition & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,19 @@
"example": "ts-node example/example",
"build": "ts-node rollup.build",
"test": "jest",
"lint": "eslint -c .eslintrc.json --ext ts,tsx src",
"storybook": "start-storybook -p 9000",
"storybook:build": "build-storybook -c .storybook -o docs"
"lint": "eslint -c .eslintrc.json --ext ts,tsx src"
},
"peerDependencies": {
"@hpcc-js/wasm": "^0.3.13",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"ts-graphviz": "^0.13.1"
},
"peerDependenciesMeta": {
"@hpcc-js/wasm": {
"optional": true
}
},
"dependencies": {
"prop-types": "^15.7.2",
"react-reconciler": "^0.25.1"
},
"devDependencies": {
"@hpcc-js/wasm": "^0.3.13",
"@rollup/plugin-commonjs": "^11.1.0",
"@storybook/addon-knobs": "^5.3.18",
"@storybook/addon-storysource": "^5.3.18",
"@storybook/react": "^5.3.18",
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.4",
"@testing-library/react-hooks": "^3.2.1",
Expand Down
34 changes: 0 additions & 34 deletions src/components/Graphviz.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions src/components/__tests__/Graphviz.spec.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/__tests__/__snapshots__/Graphviz.spec.tsx.snap

This file was deleted.

31 changes: 0 additions & 31 deletions src/hooks/use-rendered.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './renderer/render';
export * from './hooks/use-rendered';
export * from './hooks/use-cluster';
export * from './hooks/use-cluster-map';
export * from './hooks/use-graphviz-context';
Expand All @@ -10,7 +9,6 @@ export * from './hooks/use-edge';
export * from './hooks/use-node';
export * from './hooks/use-rendered-id';
export * from './hooks/use-root-cluster';
export * from './components/Graphviz';
export * from './components/HtmlLike';
export * from './components/Graph';
export * from './components/Digraph';
Expand Down
43 changes: 0 additions & 43 deletions src/stories/animations.stories.tsx

This file was deleted.

Loading