MediaWiki/Extension/DrawioEditor: Unterschied zwischen den Versionen

Aus Foxwiki
Zeile 4: Zeile 4:


{{#drawio:DrawioEditor1|width=400px}}
{{#drawio:DrawioEditor1|width=400px}}
=== Add a chart === <!--T:6-->
</translate>
<ol>
<li>Add the following tag to any wiki page to insert a draw.io chart:
{{#drawio:ChartName}}
<code>ChartName</code> must be unique and will be used as the basename for the backing file.</li>
<li>Save the wiki page.</li>
<li>Since no chart exists at this point, a placeholder will be shown where you've put the drawio tag. Click on the Edit link at the top right of it.</li>
<li>Draw your chart, click Save to save and Exit to leave Edit mode.</li>
</ol>
<translate>
=== Edit a chart === <!--T:7-->
</translate>
Each chart will have an Edit link at its top right.
Click it to get back into the editor.
Click Save to save and Exit to get out of the editor.
If a wiki page has multiple charts, only one can be edited at the same time.
<translate>
=== View or revert to old versions === <!--T:8-->
</translate>
On each save, a new version of the backing file will be added to the wiki file store.
You can get there by clicking the chart while you're not editing.
There you can look at and revert to old versions like with any file uploaded to the wiki.
<translate>
=== Options === <!--T:9-->
</translate>
Options are appended to the tag separated by <code>|</code>.
For example:
{{#drawio:ChartName|max-width=500px}}
<translate>
=== Chart dimensions === <!--T:10-->
</translate>
While the defaults are good under most circumstances, it may be necessary to control how your chart is displayed.
The following options can be used for that:
* width: Sets the chart width. Defaults to <code>100%</code>.
* max-width: Set the maximum chart width if width is relative. Defaults to <code>chart</code>.
* height: Sets the chart height. Defaults to <code>auto</code>. Usually not used.
These option take any absolute CSS length value as argument, for example:
* <code>400px</code>
* <code>80%</code>
* <code>auto</code>
The keyword <code>chart</code> has a special meaning and stands for the actual size of the chart.
When the chart is saved, the image dimensions are automatically adjusted.
Usually it's preferable to use <code>chart</code> instead of a fixed pixel value.
The default behaviour is the let the chart scale (<code>width=100%</code> and <code>height=auto</code>) until it reaches its actual width stored in the chart (<code>max-width=chart</code>).
If you want it to scale further or less, you can adjust max_width manually.
Use <code>none</code> to allow infinite scaling.
If you just want a fixed width, set ''width'' to <code>chart</code> or some fixed CSS value and leave ''height'' on <code>auto</code>.
Unless you need a fixed sized image area before the image is actually loaded or really need to scale based on height, there is usually no point in setting ''height''.
If you set it you probably should set ''width'' to <code>auto</code>, or when setting both use <code>chart</code> so you don't need to update the values manually every time your image changes.
Examples
* Let the chart scale until it reaches its actual width (default):
{{#drawio:ChartName}}
Same as:
{{#drawio:ChartName|width=100%|max-width=chart|height=auto}}
* Let the chart scale until it's 800 px wide:
{{#drawio:ChartName|max-width=800px}}
* Let the chart scale infinitely:
{{#drawio:ChartName|max-width=none}}
* Fixed width:
{{#drawio:ChartName|width=600px}}
* Fixed width using the actual chart width:
{{#drawio:ChartName|width=chart}}
* Fixed height and width using the actual chart dimensions:
{{#drawio:ChartName|width=chart|height=chart}}
<translate>
<noinclude>
<noinclude>
== Anhang ==
== Anhang ==
=== Siehe auch ===
=== Siehe auch ===

Version vom 18. Mai 2023, 10:25 Uhr

topic - Kurzbeschreibung

Beschreibung

{{#drawio:DrawioEditor1|width=400px}}


Add a chart

</translate>

  1. Add the following tag to any wiki page to insert a draw.io chart: {{#drawio:ChartName}} ChartName must be unique and will be used as the basename for the backing file.
  2. Save the wiki page.
  3. Since no chart exists at this point, a placeholder will be shown where you've put the drawio tag. Click on the Edit link at the top right of it.
  4. Draw your chart, click Save to save and Exit to leave Edit mode.

<translate>

Edit a chart

</translate> Each chart will have an Edit link at its top right. Click it to get back into the editor. Click Save to save and Exit to get out of the editor. If a wiki page has multiple charts, only one can be edited at the same time.

<translate>

View or revert to old versions

</translate> On each save, a new version of the backing file will be added to the wiki file store. You can get there by clicking the chart while you're not editing. There you can look at and revert to old versions like with any file uploaded to the wiki.

<translate>

Options

</translate> Options are appended to the tag separated by |. For example:

{{#drawio:ChartName|max-width=500px}}

<translate>

Chart dimensions

</translate> While the defaults are good under most circumstances, it may be necessary to control how your chart is displayed. The following options can be used for that:

  • width: Sets the chart width. Defaults to 100%.
  • max-width: Set the maximum chart width if width is relative. Defaults to chart.
  • height: Sets the chart height. Defaults to auto. Usually not used.

These option take any absolute CSS length value as argument, for example:

  • 400px
  • 80%
  • auto

The keyword chart has a special meaning and stands for the actual size of the chart. When the chart is saved, the image dimensions are automatically adjusted. Usually it's preferable to use chart instead of a fixed pixel value.

The default behaviour is the let the chart scale (width=100% and height=auto) until it reaches its actual width stored in the chart (max-width=chart).

If you want it to scale further or less, you can adjust max_width manually. Use none to allow infinite scaling.

If you just want a fixed width, set width to chart or some fixed CSS value and leave height on auto. Unless you need a fixed sized image area before the image is actually loaded or really need to scale based on height, there is usually no point in setting height. If you set it you probably should set width to auto, or when setting both use chart so you don't need to update the values manually every time your image changes. Examples

  • Let the chart scale until it reaches its actual width (default):
{{#drawio:ChartName}}

Same as:

{{#drawio:ChartName|width=100%|max-width=chart|height=auto}}
  • Let the chart scale until it's 800 px wide:
{{#drawio:ChartName|max-width=800px}}
  • Let the chart scale infinitely:
{{#drawio:ChartName|max-width=none}}
  • Fixed width:
{{#drawio:ChartName|width=600px}}
  • Fixed width using the actual chart width:
{{#drawio:ChartName|width=chart}}
  • Fixed height and width using the actual chart dimensions:
{{#drawio:ChartName|width=chart|height=chart}}

<translate>



Anhang

Siehe auch

Sicherheit

Dokumentation

Links

Projekt
  1. https://www.drawio.com/
  2. https://github.com/jgraph
Weblinks