Skip to content

Comparison with the official Vue shape ​

Reviewed on 2026-09-14. This page compares the current local x6-vue-html-shape implementation (0.0.0) with the published @antv/x6-vue-shape@3.0.2, which the npm registry reported as latest on that date. It does not describe every historical version of the official package.

The official package embeds Vue content in SVG foreignObject. This package keeps the X6 SVG node and renders its Vue content in a separate HTML layer. Both retain Vue components and HTML layout; the official renderer does not turn Vue templates into native SVG drawing primitives.

Official behavior below is based on its published source, not a claim that we ran its entire test suite. Verified means this repository has an automated check; implemented means supported by the current code without comprehensive test coverage; unverified means no compatibility guarantee is established.

Runtime and registration ​

The version and registration details are checked against the official package manifest, entry point and registry implementation.

Capabilityx6-vue-html-shapeOfficial 3.0.2Integration consequence
X6 versionPeer range ^3.0.1; repository tests use 3.1.8Peer range ^3.xBoth packages target X6 3
Vue versionPeer range ^3.3.0; tests use 3.5.42Declares Vue 2 and Vue 3 supportVue 2 applications cannot migrate directly
Vue compatibility layerDirect Vue importsUses vue-demiThis package has no Vue 2 rendering branch
Module outputESM and TypeScript declarationsCommonJS and ESM entry points with declarationsThis package does not expose a CommonJS entry
Base shape registrationExplicit registerVueHtmlShapeNode(); default vue-html-shapeImport registers vue-shapeImporting this package alone does not register a usable base node
Shape/component shortcutregisterVueHtmlNode({ shape, component, primer?, overwrite? })register(config)These APIs are not interchangeable aliases
Default metadata in shortcutForwards X6 node configuration, including inheritForwards additional node metadata and supports inheritBoth use X6 node defaults for dimensions, ports and attributes
Duplicate shape nameRejects by default; explicit overwrite: trueregister overwritesRepeated registration must be intentional
Component lookupNode component, then shape registry, then default-shape registryReads the shape registryOld examples using inline node components need version-specific interpretation
Registry managementExplicit get/register/unregister/clear helpersExposes shapeMaps and registerClearing a component registry is not graph disposal
Registry scopeShared across graphs importing the same package instanceShared registryGraph-specific Teleport does not make shape names graph-local
Compatibility aliasOptional vue-shape aliasDefault nameAlias compatibility covers shape names, not all APIs or rendering semantics

Vue rendering and state ​

These distinctions follow the official view implementation and Teleport implementation. The comparison of props and host context refers to Vue 3 execution paths.

Capabilityx6-vue-html-shapeOfficial 3.0.2
Standalone mountOne Vue app per node when no host is mountedAlso has a standalone Vue app path
Node/graph contextnode/graph props and getNode/getGraph injectionProvides the same Vue 3 context
Host integrationcreateVueHtmlTeleport(graph)getTeleport()
Host scopeOne mounted host per Graph; duplicate host rejectedModule-wide host and entries; target IDs include graph identity
Multiple graphsSeparate hosts can inherit different provider trees; identical node IDs testedGraph identity distinguishes entries, but the host is shared
Parent providers and global componentsVerified through TeleportAvailable through its host-tree Teleport path
Directives and app plugin contextInherited through the Vue tree; individual integrations unverifiedSame Vue-tree principle; validate individual integrations
Extra component propsNode props supports updates and removal, retaining local stateNo equivalent node props forwarding in the inspected view
Component replacementDifferent resolved component remounts; missing component removes content if no fallback existsIts Vue render action unmounts before mounting the registry component
Geometry changesDo not remount componentsSVG geometry does not itself invoke its Vue render action
Forced remountkeepAliveOnUpdate: false on component/data/props render updatesNo matching option
Reactive node datauseX6NodeData(node) subscribes to change:dataNo matching composable in the inspected exports
Data updatesDefault preserves the component; components must consume reactive data explicitlyIts Vue action map does not itself remount on data changes
Live host switchingUnsupported; mount the host before nodes and keep it aliveDo not assume runtime host switching is portable

Using an HTML layer does not remove the need for Teleport. The layer chooses the DOM location; the host preserves Vue ancestry. Without a host, registering this package with app.use(...) does not transfer the app's providers or plugins into standalone node apps. See Vue context for the mount order.

Geometry, HTML and graph interactions ​

The official node markup is defined in its node implementation. Its SVG content follows X6's coordinate system. This package recreates that relationship for external HTML using the graph matrix and node-centered rotation.

Capabilityx6-vue-html-shapeOfficial approach / consequence
HTML rendering locationSeparate overlay; no foreignObject generatedHTML inside SVG foreignObject
Position and size changesVerified against actual SVG boundsContent stays in its SVG node
Zoom and panShared inherited CSS matrix; verifiedInherited SVG viewport transform
Node rotationCentered rotation; verifiedInherited node transform
Nonuniform scale and affine matrixVerified, including a matrix with off-diagonal termsInherited SVG matrix
Direct matrix/graph rotation changesViewport attribute observer; updates after the mutation callbackApplied in the SVG tree
Unscaled content optionscaleContent: false; transformed box retained, content laid out at screen scaleNo matching package option
Custom mount targetgetContainer; tested for containers sharing the graph originView mounts at its foContent target
Wrapper classes/stylesDynamic htmlClassName/htmlStyle, including removalStyle the Vue component and SVG markup
Node mouse draggingReal browser drag and node:moved verifiedNative X6 NodeView path
Input focusReal browser focus/fill verifiedHas a guard for several text-like input types
Buttons, links and editorsBroader guard for controls, editable ancestors and data-x6-vue-stop; unit testedBroader control guards are not present in the inspected override
Touch interactiontouchstart propagation guard unit testedNo equivalent broad guard established by this source review
Visibilityvisible and dynamic syncVisible handlingVisibility follows the SVG node
Disable HTML pointer handlinginteractive: false makes HTML ignore pointer inputConfigure node/component interaction in X6/Vue
SVG primerDefault transparent rect; accepts six SVG tag namesOptional primer behind Vue content
Path/polygon primer geometrySupply d/points through X6 attrs; selecting a tag is not a complete shapeCustom SVG geometry also needs attributes
PopupsMay overflow nodes, but the graph viewport clips themStill subject to embedding, CSS and browser behavior

interactive: false is not a read-only graph switch. X6 SVG elements can still receive events, and graph editing must be configured separately. A custom container must share the graph's origin and positioning context; outside the graph container, its content does not automatically receive X6's delegated pointer behavior.

Avoiding foreignObject removes the rendering path implicated in WebKit's layer-positioning report. It is not proof that every Safari/iOS version or every complex CSS component works. WebKit automation and Safari/iOS device acceptance are different forms of evidence.

Editing ecosystem, layers and export ​

The official Vue package provides a node renderer; it does not itself implement all X6 editing plugins or exporters. Its structural advantage is that Vue content participates in the SVG scene. The separate-layer tradeoffs also appear in the X6 discussion of an HTML shape without foreignObject.

CapabilityCurrent local statusOfficial comparison / required work
X6 model, edges and anchorsRetained; examples create edges and tests check scene connectionsBoth use X6 models; example edges are not a port-drag certification
HTML node-to-node z-indexSelected nodes rise above unselected nodes in the same HTML layerOfficial content participates in the SVG ordering system
Arbitrary edge/node interleavingUnavailable across the fixed SVG/HTML layersKeeping content in SVG avoids this separate-layer barrier
Ports and magnetsNative dragging verified for exposed and inset portsHTML above SVG can obscure them even though the port model exists
Selection, tools, snaplinesUnverified combinations and stacking behaviorDo not infer compatibility solely from NodeView inheritance
History/undo, clipboard, embeddingUnverified complete workflowsModels remain in X6, but Vue instance state is not automatically graph history
Scroller and transformed outer containersUnverified beyond the documented common-origin container caseAdditional coordinate/viewport integration may be required
MiniMapVue card and SVG outline previews verifiedVue previews use explicit synchronization on the secondary graph
VirtualizationUnverifiedExternal HTML content may need explicit view lifecycle integration
JSON serializationPrefer shape registry plus serializable data/props; round-trip unverifiedComponent definitions, DOM containers and functions are not portable graph data
Pure SVG exportOptional native SVG representations for Vue cardsOfficial content is in SVG, but contains embedded HTML rather than native vectors
PNG/JPEG exportUses the same X6 SVG export hook for static cardsSVG-based export needs browser/font/image/CSS validation even with the official renderer
SSRNo server-rendered graph guarantee; initialize client-sideThis comparison establishes no official Vue-node SSR guarantee

See the migration guide for native port hit areas and both MiniMap setups.

The SVG and PNG export hook uses caller-supplied SVG cards. Reproducing the live HTML appearance requires capturing the rendered graph. Arbitrary cross-layer ordering requires a separate rendering design.

Performance: what is known ​

WorkCurrent implementationWhat the comparison establishes
Normal-node pan/zoom synchronizationOne layer CSS-variable write when the matrix changes; no normal-node style loopReduces this package's JavaScript synchronization work
Browser rendering after that writeDescendants still resolve styles, compose transforms and paintDoes not establish O(1) total rendering cost or an FPS lead
Special node transformsIndividual callbacks for custom containers and unscaled contentCost depends on the number of those nodes
Node/data/props updatesLocal updates; some graph events can still request a full refreshNot every operation is constant-time
Initial Vue mountStandalone apps or a shared hostNo measured winner against official standalone/Teleport modes
Current regression check100 normal nodes; pan/zoom must not mutate their individual style attributesTests update behavior, not frame rate or a supported node-count limit
Memory and long sessionsDisposal paths testedNo comparative heap-retention or long-session benchmark published

There is currently no measured claim that this package is faster or lighter than the official renderer. A useful benchmark must use the same components, edges, data, hardware and browser versions, and compare both standalone and host mounting. Measure initial mount, data updates, pan/zoom frame times and memory after repeated graph disposal. Native SVG rectangles and text can have less work than complex Vue cards, but that is a different comparison from two Vue renderers.

Validation and adoption ​

The local baseline checked on 2026-09-14 has 45 unit tests and six browser scenarios run in three engines (18 executions). Chromium, Firefox and WebKit cover real geometry, dragging, container changes, shared transforms, Vue providers, input focus and disposal. This does not describe the official package's test count or establish equal maturity. Exact test files and remaining criteria are listed in production readiness.

Choose this implementation for a Vue 3/X6 3 application that specifically needs HTML overlay rendering and accepts its export/layering boundaries. Retain the official renderer when Vue 2 support or the SVG-integrated scene is important, unless you have verified a replacement for the required workflows.

Before adopting either renderer, validate the actual business components and plugin combinations. For this package, begin with a prerelease or controlled application trial; comparative performance and broad plugin coverage remain open. Use the migration guide instead of a package-name-only replacement.