ariel-bentu / tam-drawio

A drawio plugin which offers TAM notation
Apache License 2.0
69 stars 14 forks source link

tam-drawio

A draw.io plugin which offers TAM notation

TAM is a subset of UML2 and FMC (Fundamental Modeling Concepts) block diagrams based on DIN 66200 - (Data processing systems operation; concepts, job relationships STANDARD by Deutsches Institut Fur Normung E.V. (German National Standard), 03/01/1992)

For more information on TAM Notation, see here

draw.io is an open-source for web-based diagramming tool. It can be downloaded to run as a desktop application or consumed from diagrams.net

This plugin adds some components to draw.io, which cover the common components used in TAM's block diagrams.

How to install

Install in draw.io desktop

Note: Since draw.io v19.0.3, in the desktop (Electron) version of draw.io, plugins are disabled by default, and since v20, also are blocked from extra->configurations menu. To allow plugins, one needs to pass a command-line argument to draw.io --enable-plugins.

For Mac users, there are three possible methods:

  1. Easiest, but requires downloading an unsigned app
    • download this tar
    • extract it locally -> you will now see a macOS app
    • drag and drop it onto your 'Applications' folder
    • first time, right-click on it and select Open - you'll be prompted to Open an app with unverified developer. Choose Open - That's it.
    • Next time, you can simple double click normally to open the app.
    • Note: The tar file contains 3 files: icon, plist.info, script to run the original draw.io
  2. Easy, but not perfect:
    • Open “Script Editor”
    • Paste this code:
      do shell script "\"/Applications/draw.io.app/Contents/MacOS/draw.io\" --enable-plugins"
      quit
    • Save… -> choose “file format” to be “application”, give it a name: e.g. tamDrawIO
    • Now you have an application with your chosen name.
  3. Harder, but then seemless experience: see here

    After you enabled plugins, follow these steps:

    • Goto Menu Extras->Plugins...
    • Press Add
    • browse and select tam-drawio.js
    • Press Apply
    • Restart Drawio

in some cases if you re-install the plugin, you get the error "File Already Exists". then go to the <appData>/draw.io/plugins and remove the file manually before re-installing.

<appData> is:
- %APPDATA%   on Windows
- $XDG_CONFIG_HOME or ~/.config   on Linux
- ~/Library/Application Support   on macOS

Note for Draw.io 21.3.0 release and after!!!

Note for Draw.io 24 release and after!!!

Install in VSCode

Install in app.diagrams.net

Verify installation

An installation is successful, if you see TAM's new toolbar side-pannels, and 2 new buttons in the toolbar (as depicted in this screenshot).

Configuration:

Desktop version

Menu Extras --> Configuration

{
  "globalVars": {
    "tam": {
      "addPluginMissingLabel": true
    }
  }
}

VSCode

Add the following entry in the VSCode settings.json (F1 --> Preferences: Open Settings (JSON))

"hediet.vscode-drawio.globalVars": {
  "tam": {
    "addPluginMissingLabel": true
  }
}

Usage tips

Therefore, the plugin adds a hidden text saying: Best viewed with the TAM plugin with a link to this repo. This text field is hidden as long as you have the plugin installed. Anyone without a plugin, will see this text item. (this is also hidden in the svg representation of a model).

To disable this behavior, see the configuration section above

Contribution

Contributions are welcome. open Issues, submit pull-requests etc.

Credits

Development

To modify cloned/downloaded version of tam-drawio plugin, you don't need to run any build step. However, if you plan to contribute your change, you need to run the script that updates links in documentation.

Debug

The best way to debug the code is to load the plugin on an html version of draw.io. here are the steps:

- Run: `node drawio.js` and access the server `http://localhost:8080?dev=1`
- Now use the browser debugger to debug the plugin.

### Prerequisites
- Download and install [Node.js](https://nodejs.org/en/download/) (≥16.14.0)
- Install dependencies by running `npm install` in the root directory of this repository

To update the bookmarklet and download links in documentation, please run

npm run pages


after changing `tam-drawio.js`, before pushing the code.