-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(ui): use Async component to avoid loading ressources - WF-107
- Loading branch information
Showing
7 changed files
with
144 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { FieldType, WriterComponentDefinition } from "@/writerTypes"; | ||
import { cssClasses } from "@/renderer/sharedStyleFields"; | ||
|
||
const description = "A component that displays Plotly graphs."; | ||
|
||
const defaultSpec = { | ||
data: [ | ||
{ | ||
x: ["a", "b", "c"], | ||
y: [22, 25, 29], | ||
type: "bar", | ||
}, | ||
], | ||
}; | ||
const definition: WriterComponentDefinition = { | ||
name: "Plotly Graph", | ||
description, | ||
category: "Content", | ||
fields: { | ||
spec: { | ||
name: "Graph specification", | ||
default: JSON.stringify(defaultSpec, null, 2), | ||
desc: "Plotly graph specification. Pass it using state, e.g. @{fig}, or paste a JSON specification.", | ||
type: FieldType.Object, | ||
}, | ||
cssClasses, | ||
}, | ||
events: { | ||
"plotly-click": { | ||
desc: "Sends a list with the clicked points.", | ||
}, | ||
"plotly-selected": { | ||
desc: "Sends a list with the selected points.", | ||
}, | ||
"plotly-deselect": { | ||
desc: "Triggered when points are deselected.", | ||
}, | ||
}, | ||
}; | ||
|
||
export default definition; |
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,55 @@ | ||
import { FieldType, WriterComponentDefinition } from "@/writerTypes"; | ||
import { | ||
cssClasses, | ||
separatorColor, | ||
primaryTextColor, | ||
containerBackgroundColor, | ||
} from "@/renderer/sharedStyleFields"; | ||
|
||
const description = "A component to embed PDF documents."; | ||
|
||
const definition: WriterComponentDefinition = { | ||
name: "PDF", | ||
description, | ||
category: "Embed", | ||
fields: { | ||
source: { | ||
name: "PDF source", | ||
type: FieldType.Text, | ||
desc: "A valid URL. Alternatively, you can provide a state reference to a packed PDF file.", | ||
}, | ||
highlights: { | ||
name: "Highlights", | ||
default: JSON.stringify([]), | ||
desc: "A list of highlights to be applied to the PDF as a JSON array of strings.", | ||
type: FieldType.Object, | ||
}, | ||
selectedMatch: { | ||
name: "Selected highlight match", | ||
default: null, | ||
desc: "The index of the selected highlight match.", | ||
type: FieldType.Number, | ||
}, | ||
page: { | ||
name: "Page", | ||
type: FieldType.Number, | ||
desc: "The page to be displayed.", | ||
}, | ||
controls: { | ||
name: "Controls", | ||
type: FieldType.Text, | ||
options: { | ||
yes: "Yes", | ||
no: "No", | ||
}, | ||
desc: "Show controls to navigate the PDF.", | ||
default: "yes", | ||
}, | ||
containerBackgroundColor, | ||
separatorColor, | ||
primaryTextColor, | ||
cssClasses, | ||
}, | ||
}; | ||
|
||
export default definition; |
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