-
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
81d2379
commit 8e7b6f2
Showing
62 changed files
with
1,185 additions
and
362 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
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,33 @@ | ||
.graph_GraphT .graphVertex { | ||
cursor: pointer; | ||
} | ||
|
||
.graph_GraphT .allowDragging .graphVertex { | ||
cursor: pointer; | ||
} | ||
|
||
.graph_GraphT .allowDragging .graphVertex.grabbed { | ||
cursor: grabbing; | ||
} | ||
|
||
.graph_GraphT .graphEdge { | ||
stroke: darkgray; | ||
fill: none; | ||
} | ||
|
||
.graph_GraphT .graphEdge>text { | ||
stroke: none; | ||
fill: black; | ||
} | ||
|
||
.graph_GraphT .graphEdge.hide-text>text { | ||
display: none; | ||
} | ||
|
||
.graph_GraphT g.selected rect { | ||
stroke: navy !important; | ||
} | ||
|
||
.graph_GraphT g.selected circle { | ||
stroke: navy !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
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,3 @@ | ||
export * from "../react/dataGraph.ts"; | ||
export * from "./graphT.ts"; | ||
export * from "./sankeyGraph.ts"; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
packages/graph/src/graph2/sankeyGraph.ts → packages/graph/src/common/sankeyGraph.ts
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { GraphHtmlT, SubgraphBaseProps, EdgeBaseProps } from "./graphHtmlT.ts"; | ||
import { HtmlVertex, HtmlVertexProps } from "./vertex.ts"; | ||
|
||
export class GraphHtml extends GraphHtmlT<SubgraphBaseProps, HtmlVertexProps, EdgeBaseProps> { | ||
constructor() { | ||
super(undefined, HtmlVertex); | ||
} | ||
} | ||
GraphHtml.prototype._class += " graph_GraphHtml"; |
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,70 @@ | ||
import { svg } from "lit-html"; | ||
import { Palette, Utility } from "@hpcc-js/common"; | ||
import { extend } from "./component.ts"; | ||
import { TextBox } from "./textBox.ts"; | ||
|
||
export interface HtmlAnnotationProps { | ||
text: string; | ||
fontFamily?: string; | ||
fontSize?: number; | ||
fill?: string; | ||
stroke?: string; | ||
} | ||
|
||
export const HtmlAnnotation = ({ | ||
text, | ||
fontFamily = "FontAwesome", | ||
fontSize = 8, | ||
fill = "gray", | ||
stroke = "darkgray" | ||
}: HtmlAnnotationProps) => { | ||
const renderChar = fontFamily === "FontAwesome" ? Utility.faChar(text) : text; | ||
const textBoxTpl = TextBox({ | ||
text: { | ||
text: renderChar, | ||
fill: Palette.textColor(fill), | ||
fontFamily, | ||
fontSize, | ||
dominantBaseline: fontFamily === "FontAwesome" ? "ideographic" : undefined | ||
}, | ||
padding: 3, | ||
fill, | ||
stroke | ||
}); | ||
return extend(svg`\ | ||
<g data-click="annotation" data-click-data=${JSON.stringify({ text, fill, fontFamily, fontSize, stroke })}> | ||
${textBoxTpl} | ||
</g>`, textBoxTpl.extent.width, textBoxTpl.extent.height); | ||
}; | ||
|
||
export interface AnnotationsProps { | ||
annotations: HtmlAnnotationProps[]; | ||
padding?: number; | ||
} | ||
|
||
export const Annotations = ({ | ||
annotations, | ||
padding = 3, | ||
}: AnnotationsProps) => { | ||
let xOffset = 0; | ||
const items = annotations.map(annotationProp => { | ||
const annotation = HtmlAnnotation(annotationProp); | ||
const itemSvg = extend(svg`\ | ||
<g transform="translate(${xOffset + annotation.extent.width / 2} 0)"> | ||
${annotation} | ||
</g>`, annotation.extent.width, annotation.extent.height); | ||
xOffset += annotation.extent.width + padding; | ||
return itemSvg; | ||
}); | ||
const { width, height } = items.reduce((acc, item) => { | ||
return { | ||
width: acc.width + item.extent.width, | ||
height: Math.max(acc.height, item.extent.height) | ||
}; | ||
}, { width: (items.length - 1) * padding, height: 0 }); | ||
return extend(svg`\ | ||
<g transform="translate(${-width / 2} 0)"> | ||
${items} | ||
</g>`, width, height); | ||
}; | ||
|
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 @@ | ||
import type { HTMLTemplateResult, SVGTemplateResult } from "lit-html"; | ||
|
||
export type TemplateResult = HTMLTemplateResult | SVGTemplateResult; | ||
export type TemplateResultEx = TemplateResult & { | ||
extent?: { width: number, height: number }; | ||
}; | ||
export function extend(result: TemplateResult, width: number, height: number): TemplateResultEx { | ||
return { | ||
...result, | ||
extent: { width, height } | ||
}; | ||
} | ||
export type Component<T> = (props: T) => TemplateResult; | ||
|
Oops, something went wrong.