Skip to content

Typed diagrams ​

umlimator/all draws 28 diagram types in their own notation: UML, SysML, C4, BPMN, entity-relationship, flowchart, data flow, mindmap and cloud architecture diagrams. This page covers the entry point, the typed element envelope, typed views, and each type's vocabulary as lib/umlimator.d.ts types it. Each type's conformance note says what it draws and checks, field by field. Back to the API reference.

umlimator/all ​

js
import { render, apply, history, validate, describe } from 'umlimator/all';

umlimator/all has the same exports and types as umlimator, and draws every diagram type. umlimator alone draws maps, and a typed view as plain cards with a console warning, so a page that shows only maps stays smaller. Every function works on typed models too: validate() checks each type's rules, apply() follows each type's references when it deletes, and describe() and diff() speak each type's terms.

On a typed view, editing gestures (with editable) emit an edit event: a transaction of commands for the host to apply.

js
import { render, apply, history } from 'umlimator/all';

const steps = history(model);
const map = render(el, model, {
  view: 'classes',
  editable: true,
  on: { edit: e => map.update(steps.push(apply(steps.model, e.commands))) },
});

examples/class-editor.html is a working editor. <umlimator-map> loads umlimator-all.js by itself for a model of schema version 2.

Element ​

ts
interface Element {
  id: string; type: string; label?: string; parent?: string; props?: Record<string, unknown>; members?: Element[];
  [key: string]: unknown;
}

A model with "schemaVersion": 2 may hold typed elements: nodes, members, typed edges and fragments, all in this one envelope and one id space (an id never contains ->).

FieldWhat it is
idUnique across the whole model.
typeWhat it is, as <family>.<Name>: uml.Class, er.Entity, bpmn.Task. The tables below list each type's.
labelIts name.
parentThe element that owns it: a package, a lane, a group, a state, a software system.
propsThe type's own fields, typed below as each type's ...Props. A field written otherwise is kept as it is, and validate() reports what breaks the type's rules.
membersElements it holds in order: attributes and operations, columns, ports, lanes, regions.

A typed edge is an Element with from and to, which may name a member.

json
{
  "schemaVersion": 2,
  "nodes": [
    { "id": "order", "type": "uml.Class", "label": "Order",
      "members": [{ "id": "order.total", "type": "uml.Property", "label": "total", "props": { "valueType": "Money" } }] },
    { "id": "customer", "type": "uml.Class", "label": "Customer" }
  ],
  "edges": [
    { "id": "places", "type": "uml.Association", "from": "customer", "to": "order",
      "props": { "ends": { "to": { "multiplicity": "*" } } } }
  ],
  "views": [{ "id": "classes", "diagram": "uml.class", "nodeIds": ["order", "customer"], "edges": ["places"] }]
}

Views ​

A typed view is a MapView with diagram set to one of the values below. It may also have:

FieldWhat it is
subjectThe element the view shows the inside of: a package, a C4 system or container, a composite structure's class, a SysML frame's block.
direction'right' or 'down'. Default right; down for a flowchart, a profile, a SysML block definition or requirement view. A sequence view is always drawn down.
notationA repaint on one geometry: crowsfoot or idef1x for er, yourdon or gane-sarson for dfd.
presentPer element id, what the view shows of it: UmlPresent, UmlStructurePresent, UmlTimingPresent, a side.
fragmentsA sequence view's combined fragments.
timelineA timing view's changes and constraints (UmlTimeline).

A view whose diagram is a type the release does not draw shows its nodes as plain cards, with a warning.

UmlPresent ​

ts
interface UmlPresent { collapsed?: ('attributes' | 'operations' | 'literals' | 'activities')[]; rows?: number }

What a typed view shows of one element, in its present by the element's id: compartments not drawn, and at most rows rows in each, then "+k more".

json
"present": { "order": { "collapsed": ["operations"], "rows": 5 } }

Shared UML props ​

ts
type UmlTags = Record<string, Record<string, string>>;
interface UmlStereotypedProps { stereotypes?: string[]; tags?: UmlTags; [key: string]: unknown }
type UmlVisibility = 'public' | 'private' | 'protected' | 'package';

Any UML element may have stereotypes (a name, or Profile::name), drawn in guillemets, and their tagged values in tags, by stereotype then tag name, each value as text: { "column": { "name": "placed_at" } }. Tags are checked against the profiles applied to the element's packages (profile diagram).

The types ​

Each section names the view's diagram, the types its elements, members and lines may have, and its props types. The props types describe props; every field in them is optional.

Class diagram ​

diagram: 'uml.class'. Conformance.

TypeValues
UmlClassElementTypeuml.Class, uml.Interface, uml.Enumeration, uml.DataType, uml.PrimitiveType, uml.Package, uml.Comment
UmlClassMemberTypeuml.Property, uml.Operation, uml.EnumerationLiteral
UmlClassLineTypeuml.Association, uml.Generalization, uml.InterfaceRealization, uml.Dependency, uml.CommentLink (from client to supplier)
UmlClassifierPropsisAbstract, stereotypes
UmlPropertyPropsvisibility, valueType, multiplicity, default, isStatic, isDerived, stereotypes: + {static} /total: Money [1] = 0 as fields
UmlOperationPropsvisibility, parameters (name, valueType, direction), returnType, isStatic, isAbstract, stereotypes
UmlLinePropsends.from and ends.to, each a UmlAssociationEnd; stereotypes
UmlAssociationEndrole, multiplicity (1, *, n..m, n..*), aggregation (none, shared, composite), navigable

Object diagram ​

diagram: 'uml.object'. Conformance.

TypeValues
UmlObjectElementTypeuml.InstanceSpecification, uml.Package, uml.Comment
UmlObjectMemberTypeuml.Slot
UmlObjectLineTypeuml.Link, uml.CommentLink
UmlInstancePropsclassifier (by name or qualified name, as text), stereotypes
UmlSlotPropsvalue, as text
UmlLinkPropsassociation, the roles at ends.from and ends.to, stereotypes

Package diagram ​

diagram: 'uml.package'. Conformance.

TypeValues
UmlPackageElementTypeuml.Package, uml.Class, uml.Interface, uml.Enumeration, uml.DataType, uml.PrimitiveType, uml.Comment
UmlPackageLineTypeuml.PackageImport, uml.PackageMerge, uml.Dependency, uml.CommentLink
UmlPackageImportPropsvisibility: public (drawn «import», the default) or private («access»)

Sequence diagram ​

diagram: 'uml.sequence'. Conformance. Lifelines are listed left to right in nodeIds; messages and interaction uses are inline in the view's edges, in time order; combined fragments are in the view's fragments, each with its operands as members.

TypeValues
UmlSequenceElementTypeuml.Lifeline, uml.InteractionUse, uml.CombinedFragment
UmlSequenceMemberTypeuml.InteractionOperand (its label the guard)
UmlSequenceLineTypeuml.Message
UmlLifelinePropsrepresents (drawn name : Type), stereotypes (actor draws «actor»)
UmlMessageSortcall (the default), async, reply, create, delete
UmlMessagePropssort, replyTo (the call a reply answers), stereotypes
UmlInteractionUsePropscovers (lifeline ids), refersTo (a view)
UmlInteractionOperatoralt, opt, loop, par, break
UmlCombinedFragmentPropsoperator

Communication diagram ​

diagram: 'uml.communication'. Conformance. The view's edges lists connectors, then messages in order; message numbers are derived. Message props are UmlMessageProps.

TypeValues
UmlCommunicationElementTypeuml.Lifeline
UmlCommunicationLineTypeuml.Connector, uml.Message

Use case diagram ​

diagram: 'uml.use-case'. Conformance.

TypeValues
UmlUseCaseElementTypeuml.Actor, uml.UseCase, uml.Subject, uml.Comment
UmlUseCaseMemberTypeuml.ExtensionPoint
UmlUseCaseLineTypeuml.Association, uml.Include, uml.Extend, uml.Generalization, uml.CommentLink
UmlExtendPropsextensionPoints (ids, one at least), condition, stereotypes

Activity diagram ​

diagram: 'uml.activity'. Conformance. A node's parent is its partition, drawn as a lane.

TypeValues
UmlActivityElementTypeuml.InitialNode, uml.ActivityFinalNode, uml.FlowFinalNode, uml.Action, uml.CallBehaviorAction, uml.SendSignalAction, uml.AcceptEventAction, uml.DecisionNode, uml.MergeNode, uml.ForkNode, uml.JoinNode, uml.ObjectNode, uml.DataStoreNode, uml.ActivityPartition, uml.Comment
UmlActivityLineTypeuml.ControlFlow, uml.ObjectFlow, uml.CommentLink
UmlFlowPropsguard (drawn name [guard]), stereotypes

State machine diagram ​

diagram: 'uml.state-machine'. Conformance.

TypeValues
UmlStateMachineElementTypeuml.State, uml.Pseudostate, uml.FinalState, uml.Comment
UmlStateMachineMemberTypeuml.Region, uml.InternalTransition
UmlStateMachineLineTypeuml.Transition, uml.CommentLink
UmlStatePropsentry, do, exit, stereotypes
UmlPseudostateKindinitial, choice, junction, fork, join, shallowHistory, deepHistory, terminate
UmlPseudostatePropskind, stereotypes
UmlTransitionPropstrigger, guard, effect (drawn trigger [guard] / effect), stereotypes

Interaction overview diagram ​

diagram: 'uml.interaction-overview'. Conformance. Flows take UmlFlowProps; an interaction use's or inline interaction's opensView names a uml.sequence view.

TypeValues
UmlInteractionOverviewElementTypeuml.InitialNode, uml.ActivityFinalNode, uml.FlowFinalNode, uml.DecisionNode, uml.MergeNode, uml.ForkNode, uml.JoinNode, uml.InteractionUse, uml.Interaction, uml.Comment
UmlInteractionOverviewLineTypeuml.ControlFlow, uml.CommentLink

Component diagram ​

diagram: 'uml.component'. Conformance.

TypeValues
UmlComponentElementTypeuml.Component, uml.Interface, uml.Artifact, uml.Package, uml.Comment
UmlComponentMemberTypeuml.Port
UmlComponentLineTypeuml.InterfaceRealization, uml.ComponentRealization, uml.Usage, uml.Connector, uml.Dependency, uml.Manifestation, uml.CommentLink
UmlPortPropsvalueType (drawn name : Type), stereotypes
UmlConnectorPropskind (assembly, the default, or delegation); in a composite structure view, ends.from.part or ends.to.part; stereotypes
UmlStructurePresentas: 'ball' (an interface as a ball), a port's side, and on a part each of its type's ports' sides

Deployment diagram ​

diagram: 'uml.deployment'. Conformance.

TypeValues
UmlDeploymentElementTypeuml.Node, uml.Device, uml.ExecutionEnvironment, uml.Artifact, uml.DeploymentSpecification, uml.Component, uml.Comment
UmlDeploymentLineTypeuml.Deployment, uml.Manifestation, uml.CommunicationPath, uml.Dependency, uml.CommentLink

Composite structure diagram ​

diagram: 'uml.composite-structure'. Conformance. The view's subject is drawn as a box holding its parts and collaboration uses.

TypeValues
UmlCompositeStructureElementTypeuml.Class, uml.Component, uml.Collaboration, uml.CollaborationUse, uml.Comment
UmlCompositeStructureMemberTypeuml.Property (a part or role), uml.Port
UmlCompositeStructureLineTypeuml.Connector, uml.RoleBinding, uml.CommentLink
UmlPartPropsvalueType, multiplicity, aggregation (composite, shared: drawn dashed), stereotypes
UmlCollaborationUsePropscollaboration, stereotypes

Profile diagram ​

diagram: 'uml.profile'. Conformance.

TypeValues
UmlProfileElementTypeuml.Profile, uml.Stereotype, uml.MetaclassReference, uml.Enumeration, uml.Package, uml.Comment
UmlProfileMemberTypeuml.Property (a tag definition), uml.EnumerationLiteral
UmlProfileLineTypeuml.Extension, uml.ProfileApplication, uml.Generalization, uml.CommentLink
UmlStereotypePropsisAbstract
UmlExtensionPropsisRequired

Timing diagram ​

diagram: 'uml.timing'. Conformance. Lifelines are listed top to bottom in nodeIds; messages are inline in the view's edges; changes and constraints are in its timeline.

TypeValues
UmlTimingElementTypeuml.Lifeline
UmlTimingLineTypeuml.Message
UmlTimingLifelinePropsrepresents, states (top to bottom), stereotypes, tags
UmlTimingMessagePropssort (call, async, reply), replyTo, sentAt, receivedAt, stereotypes
UmlTimelineunit, changes, constraints
UmlTimingChange{ id, lifeline, at, state }
UmlTimingConstraint{ id, type, from, to, label }, type uml.DurationConstraint or uml.TimeConstraint
UmlTimingPresentas: 'values': a value lifeline

Information flow diagram ​

diagram: 'uml.information-flow'. Conformance.

TypeValues
UmlInformationFlowElementTypeuml.Class, uml.Interface, uml.Component, uml.Actor, uml.InformationItem, uml.Comment
UmlInformationFlowLineTypeuml.InformationFlow, uml.CommentLink
UmlInformationFlowPropsconveyed (ids of items or classifiers)

Entity-relationship diagram ​

diagram: 'er'. Conformance. notation: crowsfoot (default) or idef1x.

TypeValues
ErElementTypeer.Entity, uml.Comment
ErMemberTypeer.Column
ErLineTypeer.Relationship (from the referenced entity to the referring one), uml.CommentLink
ErColumnPropsdataType, primaryKey, foreignKey, references (a column id), nullable, unique
ErRelationshipPropsidentifying, ends.from.multiplicity, ends.to.multiplicity

Flowchart ​

diagram: 'flowchart'. Conformance. Laid out down by default.

TypeValues
FlowchartElementTypeflow.Terminator, flow.Process, flow.Decision, flow.InputOutput, flow.PredefinedProcess, flow.Document, flow.Database, flow.ManualInput, flow.Delay, flow.Connector, uml.Comment
FlowchartLineTypeflow.Flow, uml.CommentLink

Data flow diagram ​

diagram: 'dfd'. Conformance. notation: yourdon (default) or gane-sarson. A process's opensView names its level.

TypeValues
DfdElementTypedfd.Process, dfd.DataStore, dfd.ExternalEntity, uml.Comment
DfdLineTypedfd.DataFlow, uml.CommentLink
DfdNumberPropsnumber (1, 1.2, D1)

C4 ​

diagram one of the six C4ViewType values. Conformance.

TypeValues
C4ViewTypec4.landscape, c4.context, c4.container, c4.component, c4.dynamic, c4.deployment
C4ElementTypec4.Person, c4.SoftwareSystem, c4.Container, c4.Component, c4.DeploymentNode, c4.ContainerInstance, uml.Comment
C4LineTypec4.Relationship (its label the description), uml.CommentLink
C4ElementPropsdescription, technology, external, shape (a card Shape other than node, which is the deployment view's: box, person, robot, browser, window, terminal, mobile, cylinder, pipe, folder, document or hexagon; any other name draws the default, person for a person and box for the rest), container (an instance's container)
C4RelationshipPropstechnology

SysML ​

diagram one of the four SysmlViewType values. Conformance: requirement, block definition, internal block, parametric.

TypeValues
SysmlViewTypesysml.requirement, sysml.block-definition, sysml.internal-block, sysml.parametric
SysmlElementTypesysml.Requirement, sysml.TestCase, sysml.Block, sysml.InterfaceBlock, sysml.ConstraintBlock, sysml.ValueType, uml.Package, uml.Comment
SysmlMemberTypesysml.PartProperty, sysml.ReferenceProperty, sysml.ValueProperty, sysml.ConstraintProperty, sysml.Port, sysml.FlowProperty, sysml.ConstraintParameter, uml.Operation
SysmlLineTypesysml.DeriveReqt, sysml.Satisfy, sysml.Verify, sysml.Refine, sysml.Trace, sysml.Copy, sysml.Connector, sysml.BindingConnector, uml.Association, uml.Generalization, uml.Dependency, uml.CommentLink
SysmlRequirementPropsreqId, text, risk (low, medium, high), verifyMethod, stereotypes
SysmlClassifierPropsconstraint (a constraint block's), unit, quantityKind (a value type's)
SysmlPortPropskind (proxy, full), valueType (~ before it conjugates)
SysmlFlowPropertyPropsdirection (in, out, inout), valueType
SysmlConnectorPropsends.from.part, ends.to.part, itemFlow
SysmlItemFlow{ item, direction }, direction from-to or to-from

Mindmap ​

diagram: 'mindmap'. Conformance. Topics only, the tree by parent; a first-level topic's half in present.<id>.side.

TypeValues
MindmapElementTypemindmap.Topic

Cloud architecture ​

diagram: 'gcp', 'azure' or 'aws'. Conformance: Google Cloud, Azure, AWS. Groups own what they hold by parent. A service's icon is drawn from the model's icons table at <pack>/<props.icon>, else as a glyph with its full name; the module never fetches an icon.

TypeValues
GcpElementTypegcp.Zone, gcp.Product, gcp.User
GcpLineTypegcp.Path
AzureElementTypeazure.Group, azure.Service
AzureLineTypeazure.Connector
AwsElementTypeaws.Group, aws.Service, aws.Resource
AwsLineTypeaws.Connection
CloudElementPropszoneType (on gcp.Zone), groupType (on azure.Group and aws.Group), icon (the pinned pack's own id, such as Cloud-Run)

BPMN ​

diagram: 'bpmn'. Conformance. A pool owns its lanes as members; a flow node's parent is its innermost lane, its pool, its sub-process or none.

TypeValues
BpmnElementTypebpmn.Participant, bpmn.Task, bpmn.SubProcess, bpmn.CallActivity, bpmn.StartEvent, bpmn.EndEvent, bpmn.IntermediateCatchEvent, bpmn.IntermediateThrowEvent, bpmn.BoundaryEvent, bpmn.ExclusiveGateway, bpmn.ParallelGateway, bpmn.DataObject, bpmn.DataStoreReference, bpmn.TextAnnotation, bpmn.Group
BpmnMemberTypebpmn.Lane
BpmnLineTypebpmn.SequenceFlow, bpmn.MessageFlow, bpmn.Association, bpmn.DataAssociation
BpmnElementPropsdocumentation, processRef, taskType (none, user, service), definition (none, message, timer, terminate), attachedTo, cancelActivity, calledElement, dataStoreRef, categoryValueRef
BpmnLinePropsdocumentation, direction (none, one, both: an association's arrowheads)

See also ​