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

@arktect-co/archimate-diagram-engine

v1.0.1

Published

Archimate 3.x diagram renderer

Downloads

4

Readme

archimate-diagram-engine

Archimate 3.x diagram renderer using JoinJS.

This engine can be used for server-side as well for client-side diagram rendering.

Installation

Using npm:

npm i --save @arktect-co/archimate-diagram-engine

Using Yarn:

yarn add @arktect-co/archimate-diagram-engine

Usage Example

const joint = require("jointjs");
const {ViewRenderer, ViewSettings} = require("@arktect-co/archimate-diagram-engine");

let outputGraph = new joint.dia.Graph({}, {cellNamespace: joint.shapes});
let viewNodes = [
  {
    "modelNodeId": "4ff521e69d724ae88c5a2324008613e7",
    "viewNodeId": "222f9942c68e47d5a7167e64cc435b8a",
    "name": "Node",
    "type": "node",
    "x": 240,
    "y": 180,
    "width": 145,
    "height": 85,
    "parent": null
  },
  {
    "modelNodeId": "c66f4f1de7ef4b28a5aafdbd497a2aff",
    "viewNodeId": "ea00a3ff03f541fabc96f78348b55955",
    "name": "Equipment",
    "type": "equipment",
    "x": 36,
    "y": 84,
    "width": 109,
    "height": 85,
    "parent": null
  }
];
let viewRelationships = [
  {
    "modelRelationshipId": "790f2145455347d089d7afc34f6fba45",
    "sourceId": "222f9942c68e47d5a7167e64cc435b8a",
    "targetId": "ea00a3ff03f541fabc96f78348b55955",
    "viewRelationshipId": "c8684fc5137444c09ce193268abfcb97",
    "type": "aggregation",
    "bendpoints": [
      {
        "x": 204,
        "y": 195
      }
    ]
  }
];

ViewRenderer.renderToGraph(
    outputGraph,
    viewNodes,
    viewRelationships,
    new ViewSettings({
        archimateVersion: '<=3.1',
        style: 'hybrid',
        darkColor: 'black',
        lightColor: 'white',
        textColor: 'black',
        textSize: 12,
        defaultWidth: 140,
        defaultHeight: 50,
        borderWidth: 0.8,
        edgeWidth: 0.8
    })
);

Options

  • archimateVersion: Indicates the version of ArchiMate used to set default icons and colors. The default is '<=3.1'
  • style: Color style for nodes. There are three available styles:
    • hybrid: This style combines active, behaviour and passive classification with layering.
    • layered: Differentiate only between layers.
    • element: Differentiate only between active, behaviour and passive elements.
  • darkColor: Color used for strokes (Hex colours are accepted). The default is 'black'
  • lightColor: Color used to fulfill relationship arrow shapes (Hex colours are accepted). The default is 'white'
  • textColor: Color used to fill texts. The default is 'black'
  • textSize: Text font size. The default is 12
  • defaultWidth: Reference size for element's width. The default is 140px
  • defaultHeight: Reference size for element's height. The default is 50px
  • borderWidth: Border width for elements. The default is 0.8
  • edgeWidth: Width of the relationship stroke. The default is 0.8