Search 1.9 billion lines of Odoo code on GitHub

web_widget_mermaid

Author: Therp BV,Odoo Community Association (OCA)
License: AGPL-3
Branch: 12.0
Repository: 001101/web-1
Dependencies: web
Languages: HTML (398, 0.7%), JavaScript (56483, 98.5%), Python (16, 0.0%), Sass (325, 0.6%), XML (35, 0.1%), and reStructuredText (115, 0.2%)
Other branches: 10.0, and 12.0-ocabot-merge-pr-1570-by-pedrobaeza-bump-patch
Other repositories: 965714601/web-1, AITIC/web, Abdulrahman3282/web, AlexandreDias23/web, Alfa-90/web, AntoniRomera/web, AyoubZahid/web, BADEP/web, BS-creator/web, BT-nstuder/web, Bochelly/web, CB-Gran-Canaria/web, ChanFeei/web, Change2improve/web, ClancyQiao/web, ComitorDevTeam/web, Cy-Ghost/web, Daemo00/web, Dan-Stephen/web, Darknroses/web, Decikingship/web, Digital5-Odoo/web, DjamelEd/web, Dobtor-OCA/web, DreamSpacexx/web, DudhatShivam/web, ELMARDI0107/web, ERPLibre/web, Ecnart/web, EdyKend/web, ElgatodeSchrodinger/web, ForgeFlow/web, GSLabIt/web, Gabinete-Digital/web, GlodoUK/oca-web, HirenDangar/web, HomerDeoDatu/web, Ingeos/web, Jarsa/web, JoanMarin/web, JohnmarkEnriquez/web, Jonathan-pr/web, KENLYLST/web, KKamaa/web, KonaERP/web, LevelPrime/web, Martronic-SA/web, MathBenTech/web, MaxyMoos/web, Meyjan/web, MicheleZak/web, MindAndGo/web, NL66278/web, Netsoro/web, NextERP-Romania/web, Nowheresly/web, OCA-MUK/web, OCA/web, PESOL/web, Paul98isep/web, Phaunswater/web, PrenorSistemas/web, RLeeOSI/web, SanteLibre/web, Saul-Qiang2/web, SequarSrl/web, SerpentConsultingServices/web, SimoRubi/web, SirumTME/web, SolutionSeekers/web, Studio73/web, Syci-Consulting/web, Tecnativa/web, VanMoof/web, Vauxoo/web, WilldooIT/web, aaltinisik/web, acsone/web, agrista/odoo-web, ahmedgenina/web, ajinvn2019/web, akloptim/web, akretion/web, alan80080/web, androettop/web, anhvu-sg/web, ansinaesmejor/web, antilhue/web, arkyalpyae/web, asphaltzipper/web, aurestic/web, bizzappdev/web, blooparksystems/web, boskowski/web, brain-tec/web, brian10048/web, bud-e/web, camptocamp/web, chermed/web, conandark/web, coopiteasy/web, cormaza/web, dani-xtendoo/web, daramousk/web, denvian/web, diggy128/web, dingguijin/web, dndoanh/web, druidoo-dev/web, dvalladares66/web, eLBati/web, ecosoft-odoo/web, edlwise/web, ehsu0407/web, eng-eslam-a-y/web, enmasys/web, essamcis/web, etobella/web, evansadji/web, exosoftware/oca-web, fallewi/web, farinoire/web, fjouatte/web, focusate/web-oca, foramaktiv/web, gab-net/web, gfcapalbo/web, grindtildeath/web, gtorresemmanuel/web, hassanfadl/web, hbrunn/web, hiren-serpentcs/web, huntergps/web, i-vyshnevska/web, ibudgie/web, ideaspositivas-group/web, ilecyang/web, initOS/web, insscn/web, jacky82669513/web, jans23/web, janverb/web, javiergm02/web, jchanme/web, jeroen7s/web, jguerriat/web, jhonaelramos/web, josueBulle/web, kamasteve/web, karol1985/web, kejuswiss/web, khanvuthy88/web, kitworks-systems/web, kkasing11/web, kmee/web, kos94ok-3D/web, kurniawanlucky/web, leanhtuan1996/web, legalsylvain/web, lideritjnma/web, lilotter45/web, lincersolucoes/oca-web, lincoln6delta/web, liunux4odoo/web, loftwah/web, lpajaresv/web, lubw/web, luisrodriguez-e2e/web, lweiming/web, magnuscolors/web, mashanz/web, mhadi12/web, mharenz/web, mingkongz/web, mochammadrizanaufal/web, modoolar/oca-web, mohamedhagag/web, moustafakhairy4/web, multidadosti-erp/web, munawirsyam/web, myonnet/oca-web, netzweltmex/web, newtratip/web, nikhil150355/web, nilshamerlinck/web, niulinlnc/web, noorealam96/web, ntsirintanis/web, ob0420/web, onurugur/web, onyanga/web, orlandosorio/web, osamaegypt/web, osiell/web, paraita/web, petrus-v/web, phuctranerp/web, piensom/web, pnajman-modoolar/web-1, popsolutions/web, praxigento/oca-web, presenceverte/web, pythoner-3k/web, qgzhiguo/web, quentingigon/web, raizs/web, redcor/web, ristecona/web, robertsvx27/web, rquintanam/web, sahil-navadiya/web, samsagaz/web, sanjay-hercules/web, sanube/web, sbejaoui/web, scottliu/web, sebalix/web, sergiocorato/web, sewisoft/web, sgheller/web, shengyf1/web, shiram/web, shurshilov/web-1, sinandurgut07/web, solvosci/web, steingabelgaard/web, stevematos/web, stuti135/web, sunflowerit/web, syci/web, szellmark20/web, takinobori/oca-web, tarteo/web, tegin/web, thoongnv/web, tirix/web, tirma-sa/web, tpa-odoo/web, trevi-software/web, trionoharjadi/web, trobz/web, tvtma/web, ursais/web, vasiljevicmarko/web, vertelab/web, vialaurea/OCA-web, wahello/oca-web, waveFuncjs/web, x0rzkov/odoo-web, xcgd/web, xiaoyi-yanqing/web, xtjie/web, y2gsmith/web, yanpierchirino/web, zarumaru/web, zcyuefan/web, and zeroheure/web

<h1 class="title">Mermaid flowchart widget</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_mermaid"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_mermaid"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module adds a basic widget for rendering text fields as flowcharts using <a class="reference external" href="https://mermaidjs.github.io">mermaid</a>.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#demonstration" id="id2">Demonstration</a></li> <li><a class="reference internal" href="#upgrading-mermaid" id="id3">Upgrading Mermaid</a></li> <li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id5">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id6">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>Put a <code>widget=&quot;mermaid&quot;</code> attribute in relevant field tags in the view declaration:</p> <pre> <code>&lt;field name=&quot;flowchart&quot; widget=&quot;mermaid&quot;/&gt;</code> </pre> <p>Optionally, use an <code>options</code> attribute to pass a JSON object with <a class="reference external" href="https://mermaidjs.github.io/#/mermaidAPI?id=configuration">mermaid configuration</a>:</p> <pre> <code>&lt;field name=&quot;flowchart&quot; widget=&quot;mermaid&quot; options='{&quot;theme&quot;: &quot;forest&quot;, &quot;gantt&quot;: {&quot;fontSize&quot;: 14}}'/&gt;</code> </pre> <p>The syntax for creating diagrams is described in <a class="reference external" href="https://mermaidjs.github.io/#/flowchart">mermaid's documentation</a>.</p> <p>As an example, this text:</p> <pre> <code>graph LR 10.0 --&gt; 11.0 11.0 --&gt; 12.0 12.0 -.-&gt; 13.0</code> </pre> <p>Produces this flowchart:</p> <img alt="Flowchart" src="https://raw.githubusercontent.com/OCA/web/12.0/web_widget_mermaid/static/description/flowchart_example.png" /> <a name="demonstration"></a> <h2><a class="toc-backref" href="#id2">Demonstration</a></h2> <p>In demo mode, the addon adds a flowchart field to users so you can try it. This shows up in Runbot instances.</p> <a name="upgrading-mermaid"></a> <h2><a class="toc-backref" href="#id3">Upgrading Mermaid</a></h2> <p>This information is only relevant for the development of this addon, not for users.</p> <p>This addon uses a slightly tweaked build of Mermaid that works in older browsers. To reproduce it, take the following steps:</p> <ul> <li><p class="first">Clone <code>https://github.com/knsv/mermaid/</code></p> </li> <li><p class="first">Checkout the version you want to upgrade to (e.g. <code>git checkout 8.4.0</code>)</p> </li> <li><p class="first">In <code>webpack.config.base.js</code>, in <code>const jsRule = ...</code>, remove the <code>include</code> key (so all dependencies are transpiled)</p> </li> <li><p class="first">In <code>babel.config.js</code>, in <code>targets</code>, add some browsers besides <code>node: 'current'</code>. I arbitrarily went with this:</p> <pre> <code>targets: { node: 'current', ie: '11', edge: '20', firefox: '35', chrome: '45', safari: '9', }</code> </pre> </li> <li><p class="first">Run <code>yarn install</code></p> </li> <li><p class="first">Run <code>yarn build</code></p> </li> <li><p class="first">The completed file is now in <code>dist/mermaid.js</code>. Try running <code>grep 'let ' dist/mermaid.js</code> to make sure everything was transpiled. The only output should be from comments.</p> </li> <li><p class="first">Copy <code>dist/mermaid.js</code> to <code>web_widget_mermaid/static/lib/mermaid/mermaid.js</code>.</p> </li> <li><p class="first">Bump the version number in <code>__manifest__.py</code> to match the Mermaid version.</p> </li> </ul> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id4">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id5">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id6">Authors</a></h3> <ul class="simple"> <li>Therp BV</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id7">Contributors</a></h3> <ul class="simple"> <li>Jan Verbeek &lt;<a class="reference external" href="mailto:jverbeek&#64;therp.nl">jverbeek&#64;therp.nl</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id8">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_mermaid">OCA/web</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>