MediaWiki/Extension/DrawioEditor: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
|||
Zeile 30: | Zeile 30: | ||
<nowiki> {{#drawio:ChartName|max-width=500px}} </nowiki> | <nowiki> {{#drawio:ChartName|max-width=500px}} </nowiki> | ||
=== Chart dimensions === | === Chart dimensions === | ||
While the defaults are good under most circumstances, it may be necessary to control how your chart is displayed. | 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: | The following options can be used for that: | ||
Zeile 40: | Zeile 39: | ||
These option take any absolute CSS length value as argument, for example: | These option take any absolute CSS length value as argument, for example: | ||
* <code>400px</code> | * <code>400px</code> | ||
* <code>80%</code> | * <code>80%</code> | ||
Zeile 57: | Zeile 55: | ||
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''. | 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. | 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): | * Let the chart scale until it reaches its actual width (default): | ||
<nowiki>{{#drawio:ChartName}}</nowiki> | |||
{{#drawio:ChartName}} | |||
Same as: | Same as: | ||
<nowiki>{{#drawio:ChartName|width=100%|max-width=chart|height=auto}}</nowiki> | |||
{{#drawio:ChartName|width=100%|max-width=chart|height=auto}} | |||
* Let the chart scale until it's 800 px wide: | * Let the chart scale until it's 800 px wide: | ||
<nowiki>{{#drawio:ChartName|max-width=800px}}</nowiki> | |||
{{#drawio:ChartName|max-width=800px}} | |||
* Let the chart scale infinitely: | * Let the chart scale infinitely: | ||
<nowiki>{{#drawio:ChartName|max-width=none}}</nowiki> | |||
{{#drawio:ChartName|max-width=none}} | |||
* Fixed width: | * Fixed width: | ||
<nowiki>{{#drawio:ChartName|width=600px}}</nowiki> | |||
{{#drawio:ChartName|width=600px}} | |||
* Fixed width using the actual chart width: | * Fixed width using the actual chart width: | ||
<nowiki>{{#drawio:ChartName|width=chart}}</nowiki> | |||
{{#drawio:ChartName|width=chart}} | |||
* Fixed height and width using the actual chart dimensions: | * Fixed height and width using the actual chart dimensions: | ||
<nowiki>{{#drawio:ChartName|width=chart|height=chart}}</nowiki> | |||
{{#drawio:ChartName|width=chart|height=chart}} | |||
< | |||
<noinclude> | <noinclude> |
Version vom 18. Mai 2023, 09:41 Uhr
topic - Kurzbeschreibung
Beschreibung
{{#drawio:DrawioEditor1|width=400px}}
Add a chart
- 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. - Save the wiki page
- 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.
- Draw your chart, click Save to save and Exit to leave Edit mode.
Edit a chart
- 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.
View or revert to old versions
- 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.
Options
Options are appended to the tag separated by |
.
- For example
{{#drawio:ChartName|max-width=500px}}
Chart dimensions
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}}