Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to TS #146

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
61dc6a8
Rewrote to ts, tests are not running yet
w8r Jan 18, 2022
64d646d
Bump ajv from 6.10.2 to 6.12.6 (#142)
dependabot[bot] Feb 12, 2022
a2eb903
Fixed order of computeFields recomputations; fixes #124 (#125)
bluenote10 Mar 2, 2022
5cc7369
Nasty esm module probem again
w8r Jul 12, 2022
fb5fc84
typings
w8r Jul 12, 2022
0de8750
Migrating to vite
w8r Jul 18, 2022
4fc1f5c
segment intersection test
w8r Jul 18, 2022
2ac628a
sweep event tests
w8r Jul 18, 2022
7409cdf
Sweepline test
w8r Jul 18, 2022
ba5a0ca
Divide segment test
w8r Jul 18, 2022
fa92404
compare events test
w8r Jul 18, 2022
fb3ed52
Removed explicit rollup
w8r Jul 18, 2022
0416035
Compare segments test
w8r Jul 18, 2022
1d933ef
Feature type test
w8r Jul 18, 2022
b5f2e34
Main test
w8r Jul 18, 2022
3e7bc90
Tests are done
w8r Jul 18, 2022
8611e04
deps
w8r Jul 18, 2022
2676f1d
Node version
w8r Jul 18, 2022
dac8820
Job
w8r Jul 18, 2022
e1a27b5
Merge branch 'master' into dev/ts
w8r Jul 18, 2022
23f3501
Deps
w8r Jul 18, 2022
4dc1453
Registry change
w8r Jul 18, 2022
1c084f4
Dev root
w8r Jul 20, 2022
36372f0
Tests and demo
w8r Jul 24, 2022
5033233
Web is working
w8r Jul 24, 2022
4e69237
gh actions syntax
w8r Jul 24, 2022
f3be9e9
gh actions syntax
w8r Jul 24, 2022
921738f
Separated jobs
w8r Jul 24, 2022
abd691e
gh actions syntax
w8r Jul 24, 2022
f683db0
gh actions syntax
w8r Jul 24, 2022
bdc267f
gh actions syntax
w8r Jul 24, 2022
2778097
gh actions syntax
w8r Jul 24, 2022
1f70552
gh actions syntax
w8r Jul 24, 2022
eb6f2ea
Only deploy from master
w8r Jul 24, 2022
bb381ca
Replaced the boolean op control withj DAT.gui
w8r Jul 24, 2022
2596716
Proper npm links
w8r Jul 25, 2022
d3213dc
Cleanup
w8r Jul 25, 2022
fd23bf6
Cleanup deprecated
w8r Jul 25, 2022
47ac0ac
Added more perf tests
w8r Jul 25, 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
30 changes: 7 additions & 23 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"extends": ["eslint:recommended"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
Expand All @@ -23,11 +21,7 @@
"Worker": true,
"URL": true
},
"plugins": [
"promise",
"import-order",
"jsdoc"
],
"plugins": ["promise", "jsdoc"],
"rules": {
"indent": 0,
// "prefer-const": "error",
Expand All @@ -45,9 +39,7 @@
"argsIgnorePattern": "^_"
}
],
"no-constant-condition": [
"error"
],
"no-constant-condition": ["error"],
"no-multi-spaces": 0,
"semi": [
// semicolons are required
Expand Down Expand Up @@ -95,15 +87,9 @@
// no multi line strings using \
"error"
],
"no-multiple-empty-lines": [
"error"
],
"no-trailing-spaces": [
"error"
],
"no-mixed-spaces-and-tabs": [
"error"
],
"no-multiple-empty-lines": ["error"],
"no-trailing-spaces": ["error"],
"no-mixed-spaces-and-tabs": ["error"],
"curly": 0,
"brace-style": 0,
"keyword-spacing": [
Expand Down Expand Up @@ -203,9 +189,7 @@
"error",
"except-parens"
],
"no-inner-declarations": [
"error"
],
"no-inner-declarations": ["error"],
"no-console": 2,
// `console.log(...)` is allowed
"import-order/import-order": 0,
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [master]

jobs:
deploy:
if: success()
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build:demo

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: public
25 changes: 13 additions & 12 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Checkout
uses: actions/checkout@v3

- name: Build ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
- run: npm run build --if-present
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.reify-cache
npm-debug.log
dist
public
21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

53 changes: 40 additions & 13 deletions bench.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import load from 'load-json-file';
/* eslint-disable no-console */
import load from 'load-json-file';
import Benchmark from 'benchmark';
import jstsUnion from '@turf/union';
import martinez from './dist/martinez.umd';

import mfogel from 'polygon-clipping';
import * as martinez from './dist/martinez.esm.js';

/**
* Benmark Results
Expand All @@ -12,25 +13,37 @@ import martinez from './dist/martinez.umd';
* Asia x 6.32 ops/sec ±3.16% (20 runs sampled)
* Asia - JSTS x 6.62 ops/sec ±2.74% (21 runs sampled)
*/

const options = {
onStart (event) { console.log(this.name); },
onError (event) { console.log(event.target.error); },
onCycle (event) { console.log(String(event.target)); },
onStart() {
console.log(this.name);
},
onError(event) {
console.log(event.target.error);
},
onCycle(event) {
console.log(String(event.target));
},
onComplete() {
console.log('- Fastest is ' + this.filter('fastest').map('name') + '\n');
}
};

const hole_hole = load.sync('./test/fixtures/hole_hole.geojson');
const holeHole = load.sync('./test/fixtures/hole_hole.geojson');
new Benchmark.Suite('Hole_Hole', options)
.add('Martinez', () => {
martinez.union(
hole_hole.features[0].geometry.coordinates,
hole_hole.features[1].geometry.coordinates);
holeHole.features[0].geometry.coordinates,
holeHole.features[1].geometry.coordinates
);
})
.add('JSTS', () => {
jstsUnion(hole_hole.features[0], hole_hole.features[1]);
jstsUnion(holeHole.features[0], holeHole.features[1]);
})
.add('mfogel', () => {
mfogel.union(
holeHole.features[0].geometry.coordinates,
holeHole.features[1].geometry.coordinates
);
})
.run();

Expand All @@ -40,19 +53,33 @@ new Benchmark.Suite('Asia union', options)
.add('Martinez', () => {
martinez.union(
asia.features[0].geometry.coordinates,
unionPoly.geometry.coordinates);
unionPoly.geometry.coordinates
);
})
.add('JSTS', () => jstsUnion(asia.features[0], unionPoly))
.add('mfogel', () =>
mfogel.union(
asia.features[0].geometry.coordinates,
unionPoly.geometry.coordinates
)
)
.run();

const states = load.sync('./test/fixtures/states_source.geojson');
new Benchmark.Suite('States clip', options)
.add('Martinez', () => {
martinez.union(
states.features[0].geometry.coordinates,
states.features[1].geometry.coordinates);
states.features[1].geometry.coordinates
);
})
.add('JSTS', () => {
jstsUnion(states.features[0], states.features[1]);
})
.add('mfogel', () => {
mfogel.union(
states.features[0].geometry.coordinates,
states.features[1].geometry.coordinates
);
})
.run();
19 changes: 0 additions & 19 deletions demo/css/styles.css

This file was deleted.

23 changes: 0 additions & 23 deletions demo/index.html

This file was deleted.

47 changes: 0 additions & 47 deletions demo/js/booleanopcontrol.js

This file was deleted.

Loading