-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from w-gao/feat/use-preact
feat: new UI system
- Loading branch information
Showing
47 changed files
with
2,710 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "stylelint-config-standard-scss", | ||
"rules": { | ||
"selector-class-pattern": null, | ||
"custom-property-empty-line-before": null, | ||
"declaration-empty-line-before": null, | ||
"scss/at-function-pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", | ||
"scss/at-mixin-pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", | ||
"scss/dollar-variable-pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", | ||
"scss/no-duplicate-dollar-variables": true, | ||
"scss/selector-no-redundant-nesting-selector": true, | ||
"scss/no-global-function-names": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
{ | ||
"name": "@pgv/web", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"type": "module", | ||
"author": "William Gao <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"postbuild": "node ../../scripts/postbuild.js", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"@pgv/core": "0.0.1", | ||
"@preact/preset-vite": "^2.5.0", | ||
"@preact/signals-core": "^1.2.3", | ||
"@types/three": "^0.148.0", | ||
"d3": "^5.9.2", | ||
"d3-selection-multi": "^1.0.1", | ||
"preact": "^10.13.2", | ||
"sass": "^1.60.0", | ||
"three": "^0.148.0", | ||
"vite": "^4.0.0" | ||
"vite": "^4.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
export type RepoConfig = { | ||
type: "demo" | "api" | ||
id: string | ||
name: string | ||
config?: any | ||
} | ||
|
||
export type Config = { | ||
/** | ||
* Enable debug logging, etc. | ||
*/ | ||
debug: boolean | ||
|
||
/** | ||
* Whether the app is embedded in another webpage or not. Set to true to | ||
* hide components like the footer. | ||
*/ | ||
embedded: boolean | ||
|
||
/** | ||
* List of repository configurations. | ||
*/ | ||
repos: RepoConfig[] | ||
|
||
/** | ||
* The layout engine. | ||
*/ | ||
layout: "tubemap" | ||
|
||
/** | ||
* The renderer. | ||
*/ | ||
renderer: "three" | ||
} | ||
|
||
export function setDefaultOptions(config?: Partial<Config>): Config { | ||
if (config === undefined) { | ||
config = {} | ||
} | ||
|
||
if (config.debug === undefined) { | ||
config.debug = false | ||
} | ||
|
||
if (config.embedded === undefined) { | ||
config.embedded = false | ||
} | ||
|
||
if (config.repos === undefined) { | ||
config.repos = [] | ||
} | ||
|
||
if (config.layout === undefined) { | ||
config.layout = "tubemap" | ||
} | ||
|
||
if (config.renderer === undefined) { | ||
config.renderer = "three" | ||
} | ||
|
||
return config as Config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
import { Graph } from "@pgv/core/src/model/vg" | ||
import { PGVGraph } from "@pgv/core/src/model/pgv" | ||
|
||
/** | ||
* An interface for the graph layout algorithm. | ||
* Variation graph layout algorithms. | ||
*/ | ||
export interface ILayout { | ||
name: string | ||
|
||
// Apply layout to the input graph. | ||
apply(g: Graph): PGVGraph | ||
|
||
// If applicable, reset layout. | ||
reset(): void | ||
} | ||
export * from "./layout" | ||
export * from "./tubemap" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Graph } from "@pgv/core/src/model/vg" | ||
import { PGVGraph } from "@pgv/core/src/model/pgv" | ||
|
||
/** | ||
* An interface for the graph layout algorithm. | ||
*/ | ||
export interface ILayout { | ||
name: string | ||
|
||
// Apply layout to the input graph. | ||
apply(g: Graph): PGVGraph | ||
|
||
// If applicable, reset layout. | ||
reset(): void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.