Skip to content
Merged

V1.0 #15

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
94e0950
modify package.json to prepare for release
harchcode Oct 6, 2020
4e43431
Merge branch 'master' of https://github.com/harchcode/web-digraph
harchcode Oct 7, 2020
1b4f648
Merge branch 'master' of https://github.com/harchcode/web-digraph
harchcode Oct 7, 2020
97074a4
fix package description
harchcode Oct 13, 2020
6a877f1
bump version
harchcode Oct 13, 2020
447012f
update package and use tsdx
harchcode Apr 2, 2022
7204fe1
remove cache and add to gitignore
harchcode Apr 2, 2022
2dacfe8
initial, draw background
harchcode Apr 6, 2022
c5519e5
draw node and edge
harchcode Apr 11, 2022
993d43b
basic action example
harchcode Apr 12, 2022
bc1ce48
add more shapes, intersections, and fixes
harchcode Apr 13, 2022
29871c5
fix edge
harchcode Apr 14, 2022
ed2cbbb
fix intersection
harchcode Apr 16, 2022
35f34ea
render shape contents
harchcode Apr 18, 2022
8eb9b62
reset to empty proj with updated dependencies
harchcode Nov 11, 2022
cd22f63
draw background (fail)
harchcode Nov 12, 2022
426263c
basic node and edge
harchcode Nov 12, 2022
3f5f1e6
add generate on example and try experiment with get intersection point
harchcode Nov 13, 2022
905f3f9
update
harchcode Nov 13, 2022
fac2c6f
adjust default shape and draw content
harchcode Nov 13, 2022
64547fd
hover and refactor
harchcode Nov 13, 2022
a1ff6c3
add move node, create edge, and some adjustments
harchcode Nov 14, 2022
74cc560
update create path and example
harchcode Nov 14, 2022
ae41793
refactor
harchcode Nov 14, 2022
ac1a447
update and refactor
harchcode Nov 14, 2022
1b7d735
only draw node and edge if in view
harchcode Nov 14, 2022
a5ed13c
refactor and update
harchcode Nov 15, 2022
1ea3e86
use 4 canvases
harchcode Nov 15, 2022
0a7f37c
use resizeobserver
harchcode Nov 15, 2022
a1eb870
updates
harchcode Nov 16, 2022
e58c2bb
move node and try draw region
harchcode Nov 16, 2022
ac69f5e
update
harchcode Nov 16, 2022
17958c7
quad tree first attempt
harchcode Nov 17, 2022
cd98968
delete old files
harchcode Nov 17, 2022
cdb3ac0
checkpoint
harchcode Nov 17, 2022
f88519c
bg, transform, graph width and height, clipping
harchcode Nov 17, 2022
39402fa
adding nodes
harchcode Nov 17, 2022
2eb362a
add batch and edges
harchcode Nov 18, 2022
a4004c9
hover
harchcode Nov 18, 2022
95be17d
delete, drag line, update, move
harchcode Nov 18, 2022
e435844
updates
harchcode Nov 18, 2022
ac4fec8
clipping when out of the graph size
harchcode Nov 18, 2022
f3709b6
fix move and adjust
harchcode Nov 18, 2022
60fd666
rename var
harchcode Nov 18, 2022
f84ae34
update
harchcode Nov 18, 2022
cc3c49c
refactor
harchcode Nov 18, 2022
eb93a3a
set default graph size
harchcode Nov 18, 2022
1a267a5
show 0 on center initially
harchcode Nov 18, 2022
e91270d
update example to centerize generated nodes
harchcode Nov 18, 2022
7f11db8
set options
harchcode Nov 18, 2022
a8a677d
fix build script and config
harchcode Nov 19, 2022
77e5e14
retrigger ci
harchcode Nov 19, 2022
28fb064
add temporary warning on README
harchcode Nov 19, 2022
6e7a13a
update example and some functions
harchcode Nov 19, 2022
741b8d9
touch event first try
harchcode Nov 23, 2022
9deaefc
change to graph event handler and support touch input
harchcode Nov 24, 2022
661f2fb
fix label and preview script
harchcode Nov 24, 2022
2b9fc44
update README
harchcode Nov 24, 2022
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
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
dist
dist-*
node_modules
dist
dist-*
56 changes: 20 additions & 36 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
rules: {
// Error
"arrow-parens": ["error", "as-needed", { requireForBlockBody: false }],
"comma-dangle": ["error", "never"],
"max-lines": ["error", 600],
"no-console": ["error", { allow: ["warn", "error", "info"] }],
"no-param-reassign": ["error", { props: false }],
"@typescript-eslint/no-use-before-define": ["error", { functions: false }]
},
overrides: [
{
files: ["*.js", "*.jsx"],
rules: {
"@typescript-eslint/no-var-requires": "off"
}
},
{
files: ["*.js", "*.jsx", "*.ts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
]
};
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
rules: {
// Error
"arrow-parens": ["error", "as-needed", { requireForBlockBody: false }],
"comma-dangle": ["error", "never"],
"max-lines": ["error", 5000],
"no-console": ["error", { allow: ["warn", "error", "info"] }],
"no-param-reassign": "off",
"@typescript-eslint/no-use-before-define": ["error", { functions: false }]
}
};
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: [pull_request]

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
build:
name: CI on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
node: ["14.x"]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: npm run lint

- name: Test
run: npm test --ci --coverage --maxWorkers=2

- name: Build
run: npm run build

- name: Check size
run: npm run size
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
build:
name: Build and publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Build
run: npm run build

- name: Publish
run: |
echo -e "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ${{ github.workspace }}/.npmrc
npm publish
48 changes: 21 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
.nyc_output
coverage

# production
/build
/dist
/dist-*

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.cache
.rts2_cache_cjs
.rts2_cache_es
.rts2_cache_umd
node_modules
dist
dist-*
*.local
coverage
docs

# Editor directories and files
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.10.0
10 changes: 10 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
printWidth: 80,
semi: true,
singleQuote: false,
trailingComma: "none",
useTabs: false,
bracketSpacing: true,
arrowParens: "avoid",
endOfLine: "auto"
};
9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

17 changes: 10 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "typescript"],
}
{
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "typescript"],
"typescript.tsdk": "node_modules/typescript/lib"
}
Loading