🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@webwriter/flowchart

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webwriter/flowchart

Create programming flowcharts with interactive tasks. Use standardized Elements such as loops and Branchings.

latest
npmnpm
Version
2.0.9
Version published
Maintainers
3
Created
Source

Flowchart (@webwriter/flowchart@2.0.9)

License: MIT | Version: 2.0.9

Create programming flowcharts with interactive tasks. Use standardized Elements such as loops and Branchings.

Snippets

Snippets are examples and templates using the package's widgets.

NameImport Path
Erklaerung@webwriter/flowchart/snippets/Erklaerung.html
For Schleife@webwriter/flowchart/snippets/For-Schleife.html
If Else@webwriter/flowchart/snippets/If-Else.html
Switch@webwriter/flowchart/snippets/Switch.html
Kontextbeispiel@webwriter/flowchart/snippets/Kontextbeispiel.html

FlowchartWidget (<webwriter-flowchart>)

Usage

Use with a CDN (e.g. jsdelivr):

<link href="https://cdn.jsdelivr.net/npm/@webwriter/flowchart/widgets/webwriter-flowchart.css" rel="stylesheet">
<script type="module" src="https://cdn.jsdelivr.net/npm/@webwriter/flowchart/widgets/webwriter-flowchart.js"></script>
<webwriter-flowchart></webwriter-flowchart>

Or use with a bundler (e.g. Vite):

npm install @webwriter/flowchart
<link href="@webwriter/flowchart/widgets/webwriter-flowchart.css" rel="stylesheet">
<script type="module" src="@webwriter/flowchart/widgets/webwriter-flowchart.js"></script>
<webwriter-flowchart></webwriter-flowchart>

Fields

Name (Attribute Name)TypeDescriptionDefaultReflects
localize--LOCALIZEâś—
graphNodes (graphNodes)GraphNode[]Current list of graph nodes (programmatic API).[]âś“
arrows (arrows)Arrow[]Current list of arrows between nodes (programmatic API).[]âś—
getGraphNodes-Get the current nodes.-âś—
getArrows-Get the current arrows.-âś—
taskList (taskList)ItemList[]Tasks shown in the task menu.[]âś“
helpList (helpList)ItemList[]Hints shown in the help menu.[]âś“
height (height)numberCanvas height (px).400âś“
zoomLevel (zoomLevel)numberCurrent zoom percentage (50–200).100✓
canvasOffsetX (canvasOffsetX)numberHorizontal pan offset (world units).0âś“
canvasOffsetY (canvasOffsetY)numberVertical pan offset (world units).0âś“
allowStudentEdit (allowStudentEdit)booleanAllow interactive editing (adding/dragging/deleting).falseâś“
allowStudentPan (allowStudentPan)booleanAllow panning/zooming interactions.falseâś“
font (font)stringFont family used for labels.'Courier New'âś“
fontSize (fontSize)numberFont size used for labels.16âś“
theme (theme)stringColor theme name.'standard'âś“
fullscreen (fullscreen)booleanWhether the widget is currently in fullscreen mode.falseâś—
getSelectedSequence-Get the currently selected path sequence.-âś—
getActiveSequenceButton-Get the active sequence button.-âś—
setActiveSequenceButton-Set the active sequence button.-âś—
isSelectingSequence-Set path-selection mode.-âś—
solutionMessage (solutionMessage)stringMessage shown in the solution prompt.''âś—
showSolution (showSolution)booleanWhether the solution prompt is visible.falseâś—
setSelectedSequence-Programmatically set the selected path sequence.
Overwrites the internal selectedSequence with the provided ordered descriptors.
-âś—

Fields including properties and attributes define the current state of the widget and offer customization options.

Methods

NameDescriptionParameters
isEditableReturns whether the widget is currently in an editable state
based on the contenteditable attribute.
-
selectSequenceToggle path-selection mode for solution checking.
When turning off the mode, clears the current selected sequence and any selected
node/arrow/rectangle, then triggers a redraw. Also toggles the active class on
the #select-button element (if present).
-
checkSolutionCompare the currently selected path sequence with a task's expected sequence.
If length and element-wise id/type match, shows a success message; otherwise
shows a failure message. Uses showSolutionWithMessage() to display the result.
task: ItemList

Methods allow programmatic access to the widget.

Custom CSS properties

NameDescription
--scaled-grid-sizeSpacing between grid dots (derived from zoom).
--scaled-grid-dot-sizeDot radius for the background grid (derived from zoom).
--offset-xInternal canvas left offset (managed by the widget).
--offset-yInternal canvas top offset (managed by the widget).
--widget-heightWorkspace height in pixels.

Custom CSS properties offer defined customization of the widget's style.

CSS parts

NameDescription
optionsStyles the settings sidebar (tool menu).

CSS parts allow freely styling internals of the widget with CSS.

Editing config

NameValue

The editing config defines how explorable authoring tools such as WebWriter treat the widget.

No public slots, or events.

Generated with @webwriter/build@1.9.0

Keywords

webwriter-widget

FAQs

Package last updated on 01 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts