| | |
| | | import { QuartzComponentConstructor } from "./types" |
| | | import { QuartzComponentConstructor, QuartzComponentProps } from "./types" |
| | | // @ts-ignore |
| | | import script from "./scripts/graph.inline" |
| | | import style from "./styles/graph.scss" |
| | |
| | | } |
| | | |
| | | export default ((opts?: GraphOptions) => { |
| | | function Graph() { |
| | | function Graph({ displayClass }: QuartzComponentProps) { |
| | | const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph } |
| | | const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph } |
| | | return ( |
| | | <div class="graph"> |
| | | <div class={`graph ${displayClass ?? ""}`}> |
| | | <h3>Graph View</h3> |
| | | <div class="graph-outer"> |
| | | <div id="graph-container" data-cfg={JSON.stringify(localGraph)}></div> |