Giter Site home page Giter Site logo

agentlab / ldkg-ui-diags Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 3.0 6.68 MB

Web-based diagram editor

License: GNU General Public License v3.0

JavaScript 5.68% HTML 0.55% CSS 1.71% TypeScript 91.95% Shell 0.12%
rdf sparql shacl web reactjs diagram-editor react

ldkg-ui-diags's People

Contributors

amivanoff avatar artkrygin avatar mvwivs avatar shamann avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ldkg-ui-diags's Issues

Move hardcoded node and line stencils into configs

  1. Some hardcoded stencils in different places:
  • graphCore.tsx
  • Stencil.tsx
  • yoga.ts, kiwi.ts
  • interactionValidation.ts

Stencils, which should be in test configs in ViewKind/ViewDescr or storybooks only:

  • rm:GeneralCompartmentNodeStencil
  • rm:PropertiesCompartmentNodeStencil
  • rm:PropertyNodeStencil
  • rm:ClassNodeStencil
  • rm:WindTurbineStencil
  • rm:HeaterStencil
  • rm:HouseStencil
  • rm:SubstationStencil
  • rm:GeneratorStencil
  1. For arrow types we need stensils-like mechanics with protoStencil = 'rm:EdgeStencil'. Arrow stencil palette should also use registered arrow types. We should remove hardcoded custom 'lines' and move it into test configs in ViewKind/ViewDescr or storybooks only:
  • rm:AssociationArrowStencil
  • rm:InheritanceArrowStencil
  • rm:Line
  • rm:DoubleLine

Delete nodes and edges by DEL keyboard key

Main delete scenarious:

  • Single selected node or arrow
    • DEL should delete selected node or arrow
  • Parent node with childs
    • selected only parent node OR parent with all childs OR parent with some of childs)
      • DEL should delete parent and ALL it's childs
    • selected only some of childs AND parent not selected
      • DEL should delete only selected childs
  • Multi-elected nodes and/or arrows in any combinations (including parent nodes with childs)
    • DEL should delete selected nodes and/or arrows in any combinations
      • in case of parent nodes see "Parent node with childs"

See working example in Antv X6 DAG

Publishing library

For ease of use, the library should be published as a package to npm.
Additional preliminary steps:

  • add license
  • add project description to readme
  • change project name to something more expressive

Enforce source code formatting and style

  • Configure Prettier styles
    • Line endngs: LF Unix, not Windows CRLF.
    • Quotes: Single-quotes, not doubles
    • Indentation: two spaces, not tabs.
    • kebabKaseVariablesAndFunctions and CamelCaseInterfacesAndTypes
  • Re-format all sources
  • Configure Husky-Prettier precommit hook

Reduce visual noize in Cadrs diagram

  • Too much fallback images.
    • It should appears in case of broken image link only.
    • If image link is not provided, we should not sow fallback image.
  • Too obtrusive arrows. See Ontodia arrow styles
    • Make lines thinner
    • Change line and text color to more faded one (from black to gray 1-2 tones)

In should be possible to draw disconnected edges if relation class shema allows it

Subrelation Schema (targeting UsedInDiagramAsXXX classes) could allows disconnected edges (if property cardinality is 0:1) or forbids it (if property cardinality is 1:1).

Ability to draw new disconnected edge

  • disconnected from one node
  • disconnected from all nodes

Ability to edit connected edge and make in disconnected:

  • Disconnect connected edge from one node
  • Disconnect connected edge from all nodes

Stencils panel usability improvement

Stencils problems

  • Node stencil's labels are too truncated. Its hard to see quickly what is what.
    image
  • Edge stencils didn't have labels at all. We should add it. arrow's labels should be in Russian.

Stencil panel problems

  • Stencils panel's titles should be in Russian.
  • Maybe move node stencils to "Stencils' and drop "Components" to make it more compact.
  • More compact (too much height) node stencils panel (Component panel).
    image
  • Node stencils are layouted in a giant row and truncated (see pict. below). We need some sort of panel layout (like "2 in a row' grid) and "line break" to the next row.
    image
  • Edge stencils panel's background should be the same as in Node stencils panel.

Some code handles text editing

  • On nodes at diagram:
    • strange unintuitive switch between text editing and non-editing
    • text style and size changes and input borders appears while editing text in-place
  • On edges at stensil panel:
    • double-click on edge at stensil panel allows label editing

Some visual examples:

  1. Without editing
    image

  2. Class title editing
    image

  3. Class property editing
    image

Reduce visual noize in shapes diagram

  • Make shape node less intence
    • contour lines in gray color
    • title fill: maybe gray-white gradient
  • Make compartment node colors less intence, then shape node colors
  • Extract rest's title into separate rect's child element in ViewKind
  • Prefer CSS styles for nodes, node elements
    • rects: fill, border, margins, paddings
    • text labels: font, font-size..., background

Compact shapes classes DiagramKind

  • No separate top-level PropertyShape nodes, only NodeShape nodes are top-level
  • All simple-type PropertyShapes (string, int,.. all except IRI) are like UML class properties (in compartments in Class nodes)
  • Arrow types
    • Class inheritance relation (class-to-superclass) -- arrow between NodeShapes based on relation between their targetClass classes
    • Class reference relation (classA-to-classB-by-propertyC) -- arrow between shapes if there is a PropertyShape in class A with sh:nodeKind = sh:IRI and sh:class = iri of class B. Arrow label = propertyC IRI

Add props types and default values to the react functional components

In some stories we have errors with undefined onSelect if you try to move node. This types of errors should be detected at linting/compiling stage if we have strong typing specifications in the code.

  • Please, add typings and default values to the react functional components.
  • Please, add default empty funct to the onSelect() in GraphEditor's props.

History should work for roon nodes, child nodes and edges

Scenarios:

  • Single node add/delete/resize/move/edit_content
  • Single edge add/delete/move/edit_connection/edit_label
  • Multi-select (mix with root nodes, child nodes, edges) delete/move
    GUI Interfaces:
  • Toolbar buttons should
  • Hot-keys sould work (undo: Ctrl+Z, redo: Ctrl+Y)

Same selection tool interaction for diagram nodes and edges

  • Exactly the same selection visual markers for selected Nodes and Edges. Same size, same colour.
  • The same selection markers behavior (or interactivity):
    • Markers should appear after single click on edge, not on hover. Like nodes selection.
    • Selected edge should stay selected untl "click outside" (like node).

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.