Git Product home page Git Product logo

x6-svelte-shape's People

Contributors

smallshen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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

another svelte shape

lloydzhou/x6-html-shape#7

  1. using x6-html-shape
  2. 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()
  }
}
  1. 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.