x6-svelte-shape's People
x6-svelte-shape's Issues
Inherit basic shapes
Is it possible to somehow inherit x6' basic shapes like Rect
when registry has to mark inheritance as "svelte-shape" in order for this to work?
I can't figure out how to do that. I'm using x6 with ELK as per example on https://x6.antv.vision/en/examples/showcase/practices#elk.
ELK computes the layout and dimensions of nodes which I need to pass to shapes. Basic shapes has this implemented already so I'd prefer inheriting it.
Safari support
@smallshen have you tested this in safari?
We noticed today that although the x6 nodes seem to be in the correct location, have correct sizing, and edges are routed correctly, the actual svelte components are all rendered at (0,0). Not sure if it's the implementation of x6-svelte-shape or something we've done wrong
Add as a plugin on X6 repo
@smallshen great work, just used this pattern on a project we are working on.
Adding it to the main repo of x6 would be awesome: https://github.com/antvis/X6/tree/master/packages
another svelte shape
- using
x6-html-shape
- add helper function
createRender
import { Graph, Cell } from "@antv/x6";
import type { SvelteComponentTyped } from "svelte"
export default function createRender(Component: SvelteComponentTyped) {
return function render(node: Cell, graph: Graph, container: HTMLElement) {
const component = new Component({
target: container,
props: {
node,
graph,
}
})
return () => component.$destroy()
}
}
- register svelte node
import { register } from 'x6-html-shape'
import SvslteNode from './node.svelte'
const render = createRender(Component)
register({
shape: 'custom-svelte-node',
render,
width: 100,
height: 40,
})
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.