npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vosdux/react-visual-modeling-ts

v1.0.8

Published

Адаптация библиотеки react-visual-modeling под React 17.0.2 + typescript

Downloads

12

Readme

✨ Feature

  • supports React 17.0.2
  • supports Typescript

📦 Install

npm install @vosdux/react-visual-modeling-ts

Подробнее здесь

Пример работы здесь

butterfly core

Props

node - таблица edge - связь

|Название|Описание|Тип| |----|----|----| |data| Данные для отрисовки | any | |width| Ширина canvas | number | string | |height| Высота canvas | number | string | |className| className | string | |columns| Описание колонокcolumns props | Array<columns> | |nodeMenu| Меню для node | Array<menu> | |edgeMenu| Меню для edge | Array<menu> | |actionMenu| Общее меню | action[] | |config| Конфигурацияconfig props | any | |emptyContent| Контент для пустой таблицы | string | JSX. Element| |emptyWidth| Ширина пустой таблицы | number | string| |beforeDeleteNode| Колбек удаления node |??? | |beforeDeleteEdge| Колбек удаления edge |??? | |onLoaded| Событие загрузки |(canvas) => void | |onChange| Событие изменения (например добавление связи)|(data) => void| |onFocusNode| Событие фокусировки на node |(node) => void| |onFocusEdge| Событие фокусировки на edge |(edge) => void| |onFocusCanvas| Событие фокусировки на canvas | () => void| |onDblClickNode| Событие двойного клика на node |(node) => void| |onDblClickEdge| Событие двойного клика на edge |(node) => void| |selectable| ??? | boolean | |onSelect| ??? | (nodes, edges) => void |

columns

|Название|Описание|Тип| |---|---|---| |title| Наименование | string | |key| Ключ | string | |width| Ширина | number | |primaryKey| Первичный ключ | boolean | |render| Рендер метод |(key) => void|

menu

|Название|Описание|Тип| |---|---|---| |title | Наименование | string | |key | Ключ | string | |render | Рендер метод | (key) => void | |onClick| Клик | (key, data) => void |

config

|Название|Описание|Тип| |---|---|---| | disableDeleting | Отключить возможность удаления node | boolean | | disableCollapse | Отключить возможность сворачивания node | boolean | | disableEdgeCreation | Отключить возможность создавать связи в ручную | boolean | | showActionIcon | Показать главное меню | boolean | | allowKeyboard | Разрешить события с клавиатуры | boolean | | titleRender | Рендер наменования node | (title) => JSX.Element | | titleExtIconRender | Рендер иконки в шапке node | (node) => JSX.Element | | labelRender | Рендер лейбла edge | (label) => JSX.Element | | minimap | Настройки миникарты | minimap prop { }| | autoLayout | Автоматическое позициониование | layout prop { }| | gridMode | Настройки холста | grid prop { }|

grid prop

|Название|Описание|Тип| |---|---|---| | isAdsorb | ??? | boolean | | theme | Настройки темы | theme prop { } |

grid theme

|Название|Описание|Тип| |---|---|---| | shapeType | Круги или линии | string | | gap | Отступы | number | | lineWidth | Ширина линии | boolean| | lineColor | Цвет линии | string | | circleRadiu | Радиус круга | number | | circleColor | Цвет круга | string |

layout prop

|Название|Описание|Тип| |---|---|---| | type | https://github.com/alibaba/butterfly/blob/master/docs/en-US/layout.md | string | | options | https://github.com/alibaba/butterfly/blob/master/docs/en-US/layout.md | any |

minimap

|Название|Описание|Тип| |---|---|---| | enable | Включить миникарту | boolean | | config | Кофигурация | minimap props |

minimap-config-prop

|Название|Описание|Тип| |---|---|---| |nodeColor |Цвет ноды |string| |activeNodeColor|Цвет активной ноды |string| |viewportStyle |css стили - не CssProperties|Record<string, string>|

Usage

import TableBuilding from "@vosdux/react-visual-modeling-ts";
import "@vosdux/react-visual-modeling-ts/dist/esm/index.css";

export const columns = [
  {
    key: "id",
    primaryKey: true,
  },
];

export const data = {
  nodes: [
    {
      id: "aaa",
      title: "aaa",
      top: 200,
      left: 200,
      fields: [
        {
          id: "field_1",
        },
      ],
    },
    {
      id: "bbb",
      title: "bbb",
      top: 400,
      left: 400,
      fields: [
        {
          id: "field_1",
        },
      ],
    },
  ],
  edges: [
    {
      id: 1,
      sourceNode: "aaa",
      targetNode: "bbb",
      source: "field_1",
      target: "field_1",
    },
  ],
};

<TableBuilding
  columns={columns}
  data={data}
/>

ICONS

В случае проблем с иконками, добавьте в свой файл стилей следующие шрифты

@font-face {font-family: "table-build-icon"; src: url('//at.alicdn.com/t/font_2369312_0qxuga95yni.eot?t=1613541691358'); /* IE9 / src: url('//at.alicdn.com/t/font_2369312_0qxuga95yni.eot?t=1613541691358#iefix') format('embedded-opentype'), / IE6-IE8 / url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAWYAAsAAAAACwgAAAVJAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDXgqHYIZwATYCJAMcCxAABCAFhU0HdRu9CcgekqRfBAooB8AVIgAgHv6b+7wvM0k+0O4WFKJDxxJRoaoDZCNqRDULu7bEx/9BNjU0TOnmTEyU/l5+nyu9iVB6E1lcy0dQ7yjCtAP5asw+f81h2h6gEhNyRu9qTW0QXSSueyHEbu4ng1QEktWdCkX+6oACqFPlKkx1jbM1Ea9eJrYj80ZpAi1TmUHWBzx9tUayOBBYcKzYw9aok5QXrKERqSbezeIJKDWKu6wLgMfFz8d3NiFKoUzisrYcvVats0/oy4+Q+E84kAhwZX/NMD8iYTEgE7cmW6+AVI0uBrX8v5nt0NLTUKg+5WeNZ91n056TL5/+/w90t8bXQ0+K1/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DqVJ4e6vppSx0LIranNsmxtnW741hDkpyGmG4lxrXPVKPqnLPjCJnPqAlQjv+kFewZhaO3aHfijNAtwI1hZW4xO3ZCg9xgu1Dd5pXZ0LBTVWQ8A+yiNmC1U1NiQnl0V1eby3tCyYapDMrdStiXVSBOWIAnI0QDGHZbhZc26SLEcHjIhicyHAFMFa/oF4CmyeL2Xua2n6D5LKAg89HrBmwWoL6W3QbLXjtSyvVfKcqpPNLkjWpywNBJyLn7TZzAJV0/4Qsx05qWiL4diepTypgBuUxw3rz+UWtMSNqKOIFDnKqKKOhvpcpdWiuGJcXY8mDox3KjqorLI+7zcVI+MkN9uUmIncert6eWi02Xr4bswwPtpWCwAAAA==') format('woff2'), url('//at.alicdn.com/t/font_2369312_0qxuga95yni.woff?t=1613541691358') format('woff'), url('//at.alicdn.com/t/font_2369312_0qxuga95yni.ttf?t=1613541691358') format('truetype'), / chrome, firefox, opera, Safari, Android, iOS 4.2+ / url('//at.alicdn.com/t/font_2369312_0qxuga95yni.svg?t=1613541691358#table-build-icon') format('svg'); / iOS 4.1- / } @font-face { font-family: 'table-build-icon'; / project id 2369312 */ src: url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.eot'); src: url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.woff2') format('woff2'), url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.woff') format('woff'), url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.ttf') format('truetype'), url('//at.alicdn.com/t/font_2369312_wsg9aeubvfs.svg#table-build-icon') format('svg'); }