All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
0.24.0 - 2024-03-27
- Track and display fetching state for the graph data:
- Expose
AsyncModel.operations
property andAsyncModel.changeOperations
event to track active fetch operation; - Add
WithFetchStatus
component to decorate other component with fetch status on element or element/link/property type; - Update default templates to use
WithFetchStatus
;
- Expose
- Support React component lifecycle for Link templates:
- [Breaking]
LinkTemplate.render()
drastically changed to act as "render function" which returns React elements; - [Breaking] Changed
LinkTemplate.setLinkLabel()
intoEditableLinkLabel
object on the link template; - Expose
LinkPath
,LinkLabel
andLinkVertices
components as building blocks for custom link templates; - Extract existing link rendering into
DefaultLinkTemplate
andDefaultLinkPathTemplate
;
- [Breaking]
- Support computing graph layout using web workers:
- Make default diagram layout algorithm configurable via
defaultLayout
prop onWorkspace
; - Rename
layoutForcePadded
default layout function toblockingDefaultLayout
; - Make
layoutFunction
andcanvas
parameters of WorkspaceContext.performLayout() optional; - Add
defineWorker()
anduseWorker()
to register and use shared ref-counted workers; - Export
worker-protocol
sub-module to ease creation of transparent worker proxies; - Export
layout.worker
sub-module (anddefineLayoutWorker()
helper) with default layout algorithms to be imported as a worker script; - [Breaking] Change
LayoutFunction
to be a pure function fromLayoutGraph
andLayoutState
intoLayoutState
; - [Breaking] Change
layoutPaddedWith()
/layoutBiasFreePaddedWith()
to allow async usage aslayoutPadded()
/layoutPaddedBiasFree()
;
- Make default diagram layout algorithm configurable via
- Add
useWorkspace()
anduseCanvas()
hooks to access workspace and canvas context with proper error handling:- Getting these context objects directly via
useContext(WorkspaceContext)
anduseContext(CanvasContext)
is deprecated and will be subject to removal in the future release;
- Getting these context objects directly via
- Support
accept
attribute for HTML file input inToolbarActionOpen
.
- [Breaking] Make random-delay data provider decorator configurable and expose its factory under new name
makeDelayProviderDecorator()
. - [Breaking] Rename some functions and properties for consistency and documentation:
WorkspaceContext.overlayController
->overlay
;sameLink()
->equalLinks()
;ElementType
->ElementTypeModel
andRichElementType
->ElementType
;LinkType
->LinkTypeModel
andRichLinkType
->LinkType
;PropertyType
->PropertyTypeModel
andRichProperty
->PropertyType
;DiagramModelEvents.classEvent
->elementTypeEvent
;DiagramModel.{getProperty, createProperty}
->{getPropertyType, createPropertyType}
;LinkTypeOptions
->SerializedLinkOptions
;{LayoutData, LayoutElement, LayoutLink}
->{SerializedLayout, SerializedLayoutElement, SerializedLayoutLink}
;makeLayoutData()
->makeSerializedLayout()
;
- Support React 18
<StrictMode>
workspace loading:- Add
DiagramModel.discardLayout()
to be used for correctuseEffect()
cleanup; - Add
useLoadedWorkspace()
hook for easier and correct by default asynchronous workspace loading;
- Add
- Fix reloading/re-fetching class tree when importing a diagram with same data provider.
- Fix elements lagging behind when moving
Selection
box. - Fix
SelectionActionEstablishLink
being displayed when authoring mode is not active. - Fix missing inheritable CSS defaults for links in the exported diagrams.
- Fix shrinking buttons for link types in
ConnectionsMenu
. - Clear
InstancesSearch
results when loading a diagram.
0.23.0 - 2023-12-11
- Support customizable
Toolbar
widget with its actions decomposed into separate components:- Generic component for toolbar actions:
ToolbarAction
; - Default menu items:
ToolbarActionClearAll
,ToolbarActionExport
(for PNG, SVG and print); - Default panel items:
ToolbarActionUndo
,ToolbarActionRedo
,ToolbarActionLayout
,ToolbarLanguageSelector
; - Additional specialized actions:
ToolbarActionOpen
,ToolbarActionSave
;
- Generic component for toolbar actions:
- Added
Selection
canvas widget with rectangular element selection to the default workspace; - Made
Halo
andSelection
widgets customizable via action components:- Generic component for element actions:
SelectionAction
; - Specialized actions:
SelectionActionRemove
,SelectionActionZoomToFit
,SelectionActionLayout
,SelectionActionExpand
,SelectionActionConnections
,SelectionActionAddToFilter
,SelectionActionAnchor
,SelectionActionEstablishLink
;
- Generic component for element actions:
- Support multi-navigation using
SelectionActionConnections
when multiple elements are selected. - Made
HaloLink
widget customizable via action components:- Generic component for link actions:
LinkAction
; - Specialized actions:
LinkActionEdit
,LinkActionDelete
,LinkActionMoveEndpoint
,LinkActionRename
;
- Generic component for link actions:
- Add selected link highlight to
HaloLink
:- Label highlight -- displayed by default as underline;
- Path highlight -- unstyled by default, can be changed via CSS;
- Support customizable stroke and fill styles in
Navigator
and improve default colors. - Exposed SVG and raster image export options in corresponding
CanvasApi
methods. - Support for graceful close and clearing the cache in
IndexedDbCachedProvider
. - Added utility hooks for debounced event subscription:
useEventStore()
,useFrameDebouncedStore()
,useSyncStore()
. - Add
inexactCount
parameter toDataProvider.connectedLinkStats()
to allow to avoid computing full connected link type statistics where only existence of a link type is enough.
- [Breaking] Split
DiagramView
type:- Removed public
model
property to getDiagramModel
(accessible via both canvas or workspace context); - Moved
language
property with setter and corresponding event intoDiagramModel
; - Moved locale formatting methods under
DiagramModel.locale.*
; - Moved
getTypeStyle()
intoWorkspaceContext
asgetElementTypeStyle()
; - Renamed
DiagramView
->SharedCanvasState
and move underRenderingState.shared
;
- Removed public
- [Breaking] Renamed
DefaultToolbar
->Toolbar
component. - [Breaking] Renamed
CanvasApi.exportPng()
->CanvasApi.exportRaster()
. - [Breaking] Renamed
OverlayController.showEditLinkLabelForm()
->OverlayController.showRenameLinkForm()
. - [Breaking] Replaced
visible
/showLabel
properties onRichLinkType
byvisibility
property of string enum type. - Optimized link route updates via batching.
- Added custom "zoom-to-fit" icon instead of reusing a different one from Codicons.
- Improved accessibility attribute placement (including
role
,aria-*
,title
,name
, etc).
- [Breaking] Use synthetic type and label predicates in element query of
SparqlDataProvider
:- Use
urn:reactodia:sparql:{type, label}
instead ofrdf:type
andrdfs:label
as marker predicates inSparqlDataProviderSettings.elementInfoQuery
to distinguish them from properties with same predicates;
- Use
- When establishing new link and selecting an existing entity to put on canvas and connect, it should not mark the entity as "new".
- Re-route links on link type visibility change.
- Perform zoom-to-fit after loading an existing diagram instead of just centering the content.
- Fixed unintended element move when interacting with nested element scrollbar.
- Reset history after creating a new diagram or importing existing layout.
- Fix text lookup query to use public full-text search service for
WikidataSettings
.
- Removed deprecated
Dictionary
type (Record<string, T>
can be used instead). - Removed untyped
key
parameter from event listeners. - Made private
EditorController.model
property (accessible via workspace context).
0.22.0 - 2023-11-24
- Support resources represented by blank nodes in
RdfDataProvider
whenacceptBlankNodes
is enabled. - Support native scroll and pan in
PaperArea
(e.g. using mouse wheel or touchpad scrolling). - Support touch input: native pan scroll and custom pinch zoom:
- Add new coordinate conversions to
CanvasMetrics
:paperToPageCoords()
andscrollablePaneToClientCoords()
; - Add
Vector.{add, subtract, scale}
functions;
- Add new coordinate conversions to
- Create dropdown menu to improve toolbar UI, make it more compact.
- [Breaking] Introduce
GraphStructure
as a read-only view for theDiagramModel
:- Use
GraphStructure
inLinkRouter
,LinkStyle
andValidationApi
;
- Use
- [Breaking] Use consistent naming for diagram model data accessors:
- Rename method
getLinkById()
->getLink()
; - Rename methods
getClass()
/createClass()
->getElementType()
/createElementType()
; - Remove unnecessary methods
linksOfType()
,isSourceAndTargetVisible()
; - Rename classes
FatClassModel
/FatLinkType
->RichElementType
/RichLinkType
;
- Rename method
- Optimize
ElementLayer
andLinkLayer
rendering, reducing unnecessary React updates and DOM reflows:- [Breaking] Make
LinkStyle.renderLink()
explicitly depend only on link data and state for future optimizations;
- [Breaking] Make
- Ignored lookup direction
linkDirection
inRdfDataProvider.lookup()
. - Prevent creating loaded links from cluttering the command history.
- Prevent canvas scroll jumping on undo action after layout:
- Add
restoreViewport()
command to undo/redo viewport state in similar cases;
- Add
- Fix diagram export/print to correctly embed CSS for pseudo-elements and SVG images.
- Display only property values in currently selected language if possible via
DiagramView.formatPropertyList()
.
0.21.0 - 2023-11-21
- [Breaking] Expose
Element.links
only throughDiagramModel.getElementLinks()
. - [Breaking] Make
DiagramModel.addLink()
consistent withaddElement()
:addLink
andremoveLink
use command history;addLink
will error on trying to add existing link, usecreateLink()
for the previous behavior;
- Element does not redraw on its removal in some cases.
- Avoid error when trying to change element type when dragging out of another in the authoring mode.
- Link is never lost when dragging its source or target connector in the authoring mode.
0.20.0 - 2023-11-16
- Forked library as OSS project, see previous CHANGELOG if needed.
- Implemented in-memory
CommandHistory
interface by default. - Support fully customizable workspace structure with the following elements:
Workspace
- only defines shared context for other components;WorkspaceRoot
,WorkspaceLayoutRow
,WorkspaceLayoutColumn
,WorkspaceLayoutItem
- organizes components into resizable/collapsible sections;Canvas
-- displays the diagram and canvas widgets;- Canvas widgets:
DefaultToolbar
,ConnectionsMenu
,DropOnCanvas
,Halo
,HaloLink
,Navigator
,ZoomControl
; - Other components:
ClassTree
,InstancesSearch
,LinkToolbox
;
- Many changes to code structure and small changes to the naming.
- CSS classes prefix changed to
reactodia-
. - Enabled full
strict
TypeScript compiler mode with null checks. - Migrated from legacy React Context to the modern one (
React.createContext()
). - Use RDF/JS-compatible IRI and literal terms.
- Reimplemented
RdfDataProvider
based on RDF/JS-compatible in-memory RDF store. - Moved element property formatting from
ElementLayer
into element templates themselves. - Changed link type visibility settings to affect only link rendering without removing them from the graph.
- Bundle subset of Codicons for icons, removed dependency on the included Font Awesome on the host page.
- Moved default type style and link customizations into opt-in
SemanticTypeStyles
andOntologyLinkTemplates
.
- Properly batch commands to history when placing elements from the Connections dialog.
- Removed blank nodes discovery support from
SparqlDataProvider
(might be reimplemented in the future).