-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
- Loading branch information
1 parent
348b5e0
commit 726a087
Showing
8 changed files
with
200 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,34 +1,33 @@ | ||
.graph_Graph2 .graphVertex { | ||
.graph_GraphT .graphVertex { | ||
cursor: pointer; | ||
} | ||
|
||
|
||
.graph_Graph2 .allowDragging .graphVertex { | ||
.graph_GraphT .allowDragging .graphVertex { | ||
cursor: pointer; | ||
} | ||
|
||
.graph_Graph2 .allowDragging .graphVertex.grabbed { | ||
.graph_GraphT .allowDragging .graphVertex.grabbed { | ||
cursor: grabbing; | ||
} | ||
|
||
.graph_Graph2 .graphEdge { | ||
.graph_GraphT .graphEdge { | ||
stroke: darkgray; | ||
fill: none; | ||
} | ||
|
||
.graph_Graph2 .graphEdge > text { | ||
.graph_GraphT .graphEdge>text { | ||
stroke: none; | ||
fill: black; | ||
} | ||
|
||
.graph_Graph2 .graphEdge.hide-text > text { | ||
.graph_GraphT .graphEdge.hide-text>text { | ||
display: none; | ||
} | ||
|
||
.graph_Graph2 g.selected rect { | ||
stroke:red !important; | ||
.graph_GraphT g.selected rect { | ||
stroke: red !important; | ||
} | ||
|
||
.graph_Graph2 g.selected circle { | ||
stroke:red !important; | ||
} | ||
.graph_GraphT g.selected circle { | ||
stroke: red !important; | ||
} |
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,22 @@ | ||
import { html, svg, render, HTMLTemplateResult, SVGTemplateResult } from "lit-html"; | ||
import { EdgeBaseProps, GraphT, RendererT, SubgraphBaseProps, VertexBaseProps } from "./graphT.ts"; | ||
|
||
export { html, svg }; | ||
|
||
type TemplateResult = HTMLTemplateResult | SVGTemplateResult; | ||
|
||
export type Component<T> = (props: T) => TemplateResult; | ||
|
||
export function adapter<T>(component: Component<T>): RendererT<T> { | ||
return (props: T, element: SVGGElement) => { | ||
render(component(props), element as any); | ||
}; | ||
} | ||
|
||
export class GraphHtmlT<SG extends SubgraphBaseProps, V extends VertexBaseProps, E extends EdgeBaseProps<V>> extends GraphT<SG, V, E> { | ||
|
||
constructor(subgraphRenderer: Component<SG>, vertexRenderer: Component<V>, edgeRenderer: Component<E>) { | ||
super(adapter(subgraphRenderer), adapter(vertexRenderer), adapter(edgeRenderer)); | ||
} | ||
} | ||
GraphHtmlT.prototype._class += " graph_GraphHtmlT"; |
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