Skip to content

Commit

Permalink
use tsc to compile package types
Browse files Browse the repository at this point in the history
  • Loading branch information
mggower committed Sep 19, 2023
1 parent 9f92aca commit bfbaf11
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 46 deletions.
42 changes: 21 additions & 21 deletions examples/pixi-react/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Graph</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}
#graph {
width: 100vw;
height: 100vh;
}
</style>
<!-- <link href="./style.css" rel="stylesheet" /> -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div id="graph"></canvas>
<script type="module" src="./index.ts"></script>
</body>
<head>
<meta charset="utf-8" />
<title>Graph</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}
#graph {
width: 100vw;
height: 100vh;
}
</style>
<!-- <link href="./style.css" rel="stylesheet" /> -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
</head>
<body>
<div id="graph"></div>
<script type="module" src="./index.ts"></script>
</body>
</html>
17 changes: 4 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"source": "src/index.ts",
"main": "./dist/main.js",
"module": "./dist/module.js",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"types": "./dist/index.d.ts",
"files": ["dist"],
"scripts": {
"clean": "rm -rf dist && rm -rf .parcel-cache",
"format": "prettier . --write",
Expand All @@ -18,7 +16,7 @@
"lint:fix": "eslint \"src/**/**.{ts,tsx}\" --fix",
"perf": "parcel perf/index.html",
"build:tsc": "tsc --project ./tsconfig.json",
"build": "npm run clean && npm run build:tsc && parcel build",
"build": "npm run clean && parcel build && npm run build:tsc",
"examples:dev": "npm run clean && parcel examples/index.html",
"docs:dev": "npm run clean && parcel docs-src/index.html",
"docs:build": "rm -rf ./docs/ && parcel build ./docs-src/index.html --dist-dir docs/ --public-url https://sayari-analytics.github.io/trellis/ && cp ./docs-src/assets/og-image.png ./docs/"
Expand Down Expand Up @@ -70,14 +68,7 @@
"ts-loader": "^6.2.2",
"typescript": "^5.2.2"
},
"keywords": [
"graph",
"network",
"infovis",
"visualization",
"react",
"webgl"
],
"keywords": ["graph", "network", "infovis", "visualization", "react", "webgl"],
"peerDependencies": {
"react": ">=16.0"
},
Expand Down
12 changes: 2 additions & 10 deletions src/renderers/webgl/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ export class NodeRenderer<N extends Node, E extends Edge> {
this.dirty = true
this.renderer.dirty = true

const anchor =
this.labelPlacement === 'left' || this.labelPlacement === 'right'
? HORIZONTAL_ANCHOR
: VERTICAL_ANCHOR
const anchor = this.labelPlacement === 'left' || this.labelPlacement === 'right' ? HORIZONTAL_ANCHOR : VERTICAL_ANCHOR

this.labelSprite = new PIXI.Text(this.label, {
fontFamily: this.labelFamily,
Expand All @@ -225,12 +222,7 @@ export class NodeRenderer<N extends Node, E extends Edge> {
lineJoin: 'round',
stroke: this.labelBackground === undefined ? '#fff' : undefined,
strokeThickness: this.labelBackground === undefined ? 2.5 * 2.5 : 0,
align:
this.labelPlacement === 'left'
? 'right'
: this.labelPlacement === 'right'
? 'left'
: 'center',
align: this.labelPlacement === 'left' ? 'right' : this.labelPlacement === 'right' ? 'left' : 'center',
wordWrap: labelWordWrap !== undefined,
wordWrapWidth: labelWordWrap
})
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": ["src/**/*"],
"exclude": ["src/index.ts"]
"include": ["src/**/*"]
}

0 comments on commit bfbaf11

Please sign in to comment.