@webwriter/geogebra 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +354 -721
- package/assets/preview-ar.mp4 +0 -0
- package/assets/preview-bn.mp4 +0 -0
- package/assets/preview-es.mp4 +0 -0
- package/assets/preview-fa.mp4 +0 -0
- package/assets/preview-fr.mp4 +0 -0
- package/assets/preview-hi.mp4 +0 -0
- package/assets/preview-id.mp4 +0 -0
- package/assets/preview-it.mp4 +0 -0
- package/assets/preview-ja.mp4 +0 -0
- package/assets/preview-jv.mp4 +0 -0
- package/assets/preview-ko.mp4 +0 -0
- package/assets/preview-mr.mp4 +0 -0
- package/assets/preview-nl.mp4 +0 -0
- package/assets/preview-pl.mp4 +0 -0
- package/assets/preview-pt.mp4 +0 -0
- package/assets/preview-ru.mp4 +0 -0
- package/assets/preview-sw.mp4 +0 -0
- package/assets/preview-ta.mp4 +0 -0
- package/assets/preview-te.mp4 +0 -0
- package/assets/preview-th.mp4 +0 -0
- package/assets/preview-tr.mp4 +0 -0
- package/assets/preview-ur.mp4 +0 -0
- package/assets/preview-vi.mp4 +0 -0
- package/assets/preview-zh.mp4 +0 -0
- package/custom-elements.json +2189 -3437
- package/dist/chunks/{chunk-RYZMQM25.js → chunk-T5C4HMRG.js} +8 -2
- package/dist/widgets/webwriter-geogebra-3d.js +1 -3
- package/dist/widgets/webwriter-geogebra-classic.js +1 -3
- package/dist/widgets/webwriter-geogebra-geometry.js +1 -3
- package/dist/widgets/webwriter-geogebra-notes.js +1 -3
- package/dist/widgets/webwriter-geogebra-scientific.js +1 -3
- package/dist/widgets/webwriter-geogebra.js +1 -3
- package/package.json +26 -1
- package/schemas/construction.schema.json +14 -0
- package/src/components/geogebra-app.ts +100 -58
- package/src/widgets/webwriter-geogebra-3d.ts +1 -3
- package/src/widgets/webwriter-geogebra-classic.ts +1 -3
- package/src/widgets/webwriter-geogebra-geometry.ts +1 -3
- package/src/widgets/webwriter-geogebra-notes.ts +1 -3
- package/src/widgets/webwriter-geogebra-scientific.ts +1 -3
- package/src/widgets/webwriter-geogebra.ts +3 -3
- package/tests/presentation.test.ts +6 -0
package/README.md
CHANGED
|
@@ -1,785 +1,418 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<!-- webwriter:metadata:start -->
|
|
2
|
+
# Geogebra (`@webwriter/geogebra@2.2.0`)
|
|
3
|
+
[License: MIT](LICENSE) · Version 2.2.0 · `npm install @webwriter/geogebra`
|
|
3
4
|
|
|
4
5
|
Use the mathematics learning apps of GeoGebra for algebra and geometry.
|
|
6
|
+
<!-- webwriter:metadata:end -->
|
|
5
7
|
|
|
8
|
+
<!-- webwriter:manual:start -->
|
|
9
|
+
GeoGebra's math apps as widgets. They load GeoGebra from geogebra.org, so readers need an internet connection.
|
|
6
10
|
|
|
11
|
+
**Which tag.** `<webwriter-geogebra-geometry>` for ruler-and-compass constructions; `<webwriter-geogebra-classic>` for graphs with algebra view, spreadsheet or CAS, and whenever you set `perspective`; `<webwriter-geogebra-3d>` for 3D; `<webwriter-geogebra>` (Calculator Suite) when learners should pick the calculator; `<webwriter-geogebra-scientific>` for a plain calculator; `<webwriter-geogebra-notes>` for a whiteboard. For the equation editor, add `type="evaluator"` to any tag.
|
|
7
12
|
|
|
13
|
+
**Content.** Markup cannot build a construction object by object: there are no child elements to author and no attribute for GeoGebra commands. Load one with `src`: turn a material link from the author, such as geogebra.org/m/abcd1234, into `src="ggbid:abcd1234"`, and never invent an id. A material opens in the app of the tag; use `<webwriter-geogebra-classic>`, which has every view, when you do not know its app. Without `src` the app starts blank. The widget saves edits and imports in its data block, which then replaces `src`. Write nothing inside the tag, not even a fallback text; put the task in the document next to it.
|
|
8
14
|
|
|
15
|
+
**On/off attributes take the strings "true" and "false"**, unlike HTML boolean attributes: write `showtoolbar="false"` or `enablecas="true"`. A bare attribute such as `showmenubar` counts as false; a missing one keeps its default.
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
17
|
+
**Common settings.**
|
|
18
|
+
- Limit the tools with `customtoolbar`, using GeoGebra's tool numbers: 0 Move, 1 Point, 2 Line, 3 Parallel line, 4 Perpendicular line, 5 Intersect, 8 Perpendicular bisector, 9 Angle bisector, 10 Circle with center through point, 15 Segment, 16 Polygon, 19 Midpoint, 36 Angle, 38 Distance or length. It limits only the toolbar: learners can still type commands in the input line (hide it with `showalgebrainput="false"`) and edit object definitions in the right-click properties (`enablerightclick="false"` turns them off, and with them shortcuts such as Delete, so learners remove mistakes with undo). A task text may ask only for tools in the list: to have learners measure, include 38 or 36.
|
|
19
|
+
- Explore only, no constructing: `showtoolbar="false" showalgebrainput="false" enablerightclick="false"`, optionally `showreseticon="true"`. Learners can still drag free points and sliders. Add `enableshiftdragzoom="false" showzoombuttons="false"` to keep the view fixed.
|
|
14
20
|
|
|
15
|
-
Use with a CDN (e.g. [jsdelivr](https://jsdelivr.com)):
|
|
16
21
|
```html
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<webwriter-geogebra></webwriter-geogebra>
|
|
22
|
+
<webwriter-geogebra-geometry customtoolbar="0 | 1 | 15 | 10 | 5" showalgebrainput="false"></webwriter-geogebra-geometry>
|
|
23
|
+
<webwriter-geogebra-classic src="ggbid:abcd1234" showtoolbar="false" showalgebrainput="false" showreseticon="true"></webwriter-geogebra-classic>
|
|
20
24
|
```
|
|
25
|
+
<!-- webwriter:manual:end -->
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
npm install @webwriter/geogebra
|
|
26
|
-
```
|
|
27
|
+
<!-- webwriter:reference:start -->
|
|
28
|
+
## Usage
|
|
29
|
+
Each widget is a custom element with a script and a stylesheet. From a CDN:
|
|
27
30
|
|
|
28
31
|
```html
|
|
29
|
-
<link href="
|
|
30
|
-
<script type="module" src="
|
|
32
|
+
<link href="https://cdn.jsdelivr.net/npm/@webwriter/geogebra/dist/widgets/webwriter-geogebra.css" rel="stylesheet">
|
|
33
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@webwriter/geogebra/dist/widgets/webwriter-geogebra.js"></script>
|
|
31
34
|
<webwriter-geogebra></webwriter-geogebra>
|
|
32
35
|
```
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
| Name (Attribute Name) | Type | Description | Default | Reflects |
|
|
36
|
-
| :-------------------: | :--: | :---------: | :-----: | :------: |
|
|
37
|
-
| `type` (`type`) | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | app name, default: "classic". "graphing" … GeoGebra Graphing Calculator "geometry" … GeoGebra Geometry "3d" … GeoGebra 3D Graphing Calculator "classic" … GeoGebra Classic "suite" … GeoGebra Calculator Suite "evaluator" … Equation Editor "scientific" …Scientific Calculator "notes" … GeoGebra Notes | `"suite"` | ✓ |
|
|
38
|
-
| `showZoomButtons` (`showZoomButtons`) | `boolean` | States whether the zoom in / zoom out / home buttons should be shown in the Graphics View or not. Default: false | `true` | ✓ |
|
|
39
|
-
| `showFullscreenButton` (`showFullscreenButton`) | `boolean` | Whether fullscreen button should be visible | `true` | ✓ |
|
|
40
|
-
| `enableFileFeatures` (`enableFileFeatures`) | `boolean` | Determines whether file saving, file loading, sign in and Options > Save settings are enabled. This argument is ignored when menubar is not showing. Default: true | `false` | ✓ |
|
|
41
|
-
| `enableUndoRedo` (`enableUndoRedo`) | `boolean` | Determines whether Undo and Redo icons are shown. This argument is ignored when toolbar is not showing. Default: true | `false` | ✓ |
|
|
42
|
-
| `ggbStyles` (`ggbStyles`) | `string` | Custom CSS styles to apply to the GeoGebra applet. | - | ✗ |
|
|
43
|
-
| `WebwriterGeogebra.options` | - | - | `geogebraOptions` | ✗ |
|
|
44
|
-
| `WebwriterGeogebra.actions` | `object` | - | `{ importConstruction: { label: (widget: {msg: MsgFn}) => ({_: widget.msg("Import construction")}), input: {type: "file" as const, accept: ".ggb", multiple: false}, }, }` | ✗ |
|
|
45
|
-
| `WebwriterGeogebra.convertFrom` | `object` | - | `{".ggb": "importGgb"}` | ✗ |
|
|
46
|
-
| `WebwriterGeogebra.convertTo` | `object` | - | `{".ggb": "exportGgb", "image/png": "exportPng", "image/svg+xml": "exportSvg"}` | ✗ |
|
|
47
|
-
| `msg` | `MsgFn` | - | - | ✗ |
|
|
48
|
-
| `width` (`width`) | `number` | Applet width | `800` | ✓ |
|
|
49
|
-
| `height` (`height`) | `number` | Applet height | `450` | ✓ |
|
|
50
|
-
| `src` (`src`) | `string \| undefined` | Source of the GeoGebra file to load (base64-encoded string, material ID prefixed with "ggbid:", or file URL) | - | ✓ |
|
|
51
|
-
| `borderColor` (`borderColor`) | `string` | Color of the border line drawn around the applet panel (as hex rgb string). Default: gray | `"gray"` | ✓ |
|
|
52
|
-
| `borderRadius` (`borderRadius`) | `number` | Size of applet's border radius in pixels. | `1` | ✓ |
|
|
53
|
-
| `enableRightClick` (`enableRightClick`) | `boolean` | States whether right clicks should be handled by the applet. Setting this parameter to "false" disables context menus, properties dialogs and right-click-zooming. Default: true. NB also enables/disables some keyboard shortcuts eg Delete and Ctrl + R (recompute all objects). Default: true | `true` | ✓ |
|
|
54
|
-
| `enableLabelDrags` (`enableLabelDrags`) | `boolean` | States whether labels can be dragged. Default: true | `true` | ✓ |
|
|
55
|
-
| `enableShiftDragZoom` (`enableShiftDragZoom`) | `boolean` | States whether the Graphics View(s) should be moveable using Shift mouse drag (or. Ctrl + mouse drag) or zoomable using Shift + mouse wheel (or Ctrl + mouse wheel). Setting this parameter to "false" disables moving and zooming of the drawing pad. Default: true | `true` | ✓ |
|
|
56
|
-
| `errorDialogsActive` (`errorDialogsActive`) | `boolean` | States whether error dialogs will be shown if an invalid input is entered (using the Input Bar or JavaScript) Default: true | `true` | ✓ |
|
|
57
|
-
| `showMenuBar` (`showMenuBar`) | `boolean` | States whether the menubar of GeoGebra should be shown in the applet. Default: false | `false` | ✓ |
|
|
58
|
-
| `showToolBar` (`showToolBar`) | `boolean` | States whether the toolbar with the construction mode buttons should be shown in the applet. Default: false | `true` | ✓ |
|
|
59
|
-
| `showToolBarHelp` (`showToolBarHelp`) | `boolean` | States whether the toolbar help text right to the toolbar buttons should be shown in the applet | `false` | ✓ |
|
|
60
|
-
| `customToolBar` (`customToolBar`) | `string \| undefined` | Sets the toolbar according to a custom toolbar string where the int values are Toolbar Mode Values, `,` adds a separator within a menu, `\|` starts a new menu and `\|\|` adds a separator in the toolbar before starting a new menu. This will override the saved toolbar from the .ggb file / base64 string. Custom tools are numbered 100 001, 100 002, etc | - | ✓ |
|
|
61
|
-
| `showAlgebraInput` (`showAlgebraInput`) | `boolean` | States whether the algebra input line (with input field, greek letters and command list) should be shown in the applet. Default: false | `true` | ✓ |
|
|
62
|
-
| `showResetIcon` (`showResetIcon`) | `boolean` | States whether a small icon (GeoGebra ellipse) should be shown in the upper right corner of the applet. Clicking on this icon resets the applet (i.e. it reloads the file given in the filename parameter). Default: false | `false` | ✓ |
|
|
63
|
-
| `language` (`language`) | `string \| undefined` | ISO language string. GeoGebra tries to set your local language automatically (if it is available among the supported languages, of course). The default language for unsupported languages is English. If you want to specify a certain language manually, please use this parameter. | - | ✓ |
|
|
64
|
-
| `country` (`country`) | `string \| undefined` | ISO country string. This parameter only makes sense if you use it together with the language parameter. | - | ✓ |
|
|
65
|
-
| `appletId` (`appletId`) | `string \| undefined` | This parameter allows you to specify the argument passed to the JavaScript function ggbOnInit(), which is called once the applet is fully initialised. This is useful when you have multiple applets on a page. | - | ✓ |
|
|
66
|
-
| `allowStyleBar` (`allowStyleBar`) | `boolean` | Determines whether the Style Bar can be shown (or will be shown if just Graphics View 1 is showing). Default: false | `false` | ✓ |
|
|
67
|
-
| `randomize` (`randomize`) | `boolean` | Determines whether random numbers should be randomized on file load. Useful when you want the app to reload in exactly the same state it was saved. Default: true | `true` | ✓ |
|
|
68
|
-
| `randomSeed` (`randomSeed`) | `number \| undefined` | Specify seed for random numbers. Note that if you save a state of the app after user interacted with it and try to reload that state with the same randomSeed, you may get a different result. Use randomize for those use-cases. | - | ✓ |
|
|
69
|
-
| `useBrowserForJs` (`useBrowserForJs`) | `boolean` | When true, GeoGebra: runs ggbOnInit from HTML, ignores ggbOnInit from file, and ignores JS update scripts of objects in file. When false, GeoGebra: ignores ggbOnInit from HTML (use appletOnLoad parameter of GGBApplet instead), runs ggbOnInit from file, and runs JS update scripts of objects in file. Default: false | `false` | ✓ |
|
|
70
|
-
| `showLogging` (`showLogging`) | `boolean` | Determines whether logging is shown in the Browser's console. Default: false | `false` | ✓ |
|
|
71
|
-
| `capturingThreshold` (`capturingThreshold`) | `number` | Determines the sensitivity of object selection. The default value of 3 is usually fine to select and drag objects both with the mouse and touch. Use larger values (e.g. 4 or 5) to make it easier to select and drag objects. Default: 3 | `3` | ✓ |
|
|
72
|
-
| `perspective` (`perspective`) | `string \| undefined` | For values see SetPerspective_Command in the GeoGebra Manual. Just for a blank start ie shouldn't be used with material_id, filename or ggbBase64 parameters | - | ✓ |
|
|
73
|
-
| `enable3d` (`enable3d`) | `boolean \| undefined` | Whether 3D should be enabled (for exam mode). | - | ✓ |
|
|
74
|
-
| `enableCAS` (`enableCAS`) | `boolean \| undefined` | Whether CAS should be enabled (for exam mode). | - | ✓ |
|
|
75
|
-
| `algebraInputPosition` (`algebraInputPosition`) | `"algebra" \| "top" \| "bottom" \| undefined` | Determines whether input bar should be shown in algebra, on top of the applet or under the applet. When left empty (default), the position depends on file. | - | ✓ |
|
|
76
|
-
| `preventFocus` (`preventFocus`) | `boolean` | When set to true, this prevents the applet from getting focus automatically at the start. Default: false | `false` | ✓ |
|
|
77
|
-
| `scaleContainerClass` (`scaleContainerClass`) | `string \| undefined` | Name of CSS class that is used as container; applet will scale to fit into the container. | - | ✓ |
|
|
78
|
-
| `autoHeight` (`autoHeight`) | `boolean` | `true` to restrict the width of the applet and compute height automatically, add autoHeight: true. `false` if you want the applet to be restricted by both width and height of the container | `true` | ✓ |
|
|
79
|
-
| `allowUpscale` (`allowUpscale`) | `boolean` | Determines whether automatic scaling may scale the applet up. Default: false | `false` | ✓ |
|
|
80
|
-
| `playButton` (`playButton`) | `boolean` | Determines whether a preview image and a play button should be rendered in place of the applet. Pushing the play button initializes the applet. Default: false | `false` | ✓ |
|
|
81
|
-
| `scale` (`scale`) | `number` | Ratio by which the applet should be scaled (eg. 2 makes the applet 2 times bigger, including all texts and UI elements). Default: 1 | `1` | ✓ |
|
|
82
|
-
| `showAnimationButton` (`showAnimationButton`) | `boolean` | Whether animation button should be visible | `false` | ✓ |
|
|
83
|
-
| `showSuggestionButtons` (`showSuggestionButtons`) | `boolean` | Whether suggestion buttons (special points, solve) in Algebra View should be visible | `false` | ✓ |
|
|
84
|
-
| `showStartTooltip` (`showStartTooltip`) | `boolean` | Whether "Welcome" tooltip should be shown | `false` | ✓ |
|
|
85
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
86
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
87
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
88
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
89
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
90
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
91
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
92
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
93
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
94
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
95
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
96
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
97
|
-
|
|
98
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
99
|
-
|
|
100
|
-
## Methods
|
|
101
|
-
| Name | Description | Parameters |
|
|
102
|
-
| :--: | :---------: | :-------: |
|
|
103
|
-
| `importConstruction` | - | `files: File[]`
|
|
104
|
-
| `importGgb` | - | `file: File`
|
|
105
|
-
| `exportGgb` | - | -
|
|
106
|
-
| `exportPng` | - | -
|
|
107
|
-
| `exportSvg` | - | -
|
|
108
|
-
| `focus` | - | `options: FocusOptions`
|
|
109
|
-
|
|
110
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
111
|
-
|
|
112
|
-
## Events
|
|
113
|
-
| Name | Description |
|
|
114
|
-
| :--: | :---------: |
|
|
115
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
116
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
117
|
-
|
|
118
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
119
|
-
|
|
120
|
-
## CSS parts
|
|
121
|
-
| Name | Description |
|
|
122
|
-
| :--: | :---------: |
|
|
123
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
124
|
-
|
|
125
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
126
|
-
|
|
127
|
-
## Editing config
|
|
128
|
-
| Name | Value |
|
|
129
|
-
| :--: | :---------: |
|
|
130
|
-
| `content` | `text*` |
|
|
131
|
-
| `importFormats` | `.ggb` |
|
|
132
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
133
|
-
|
|
134
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
135
|
-
|
|
136
|
-
*No public slots, or custom CSS properties.*
|
|
37
|
+
With a bundler, run `npm install @webwriter/geogebra` and import `@webwriter/geogebra/widgets/webwriter-geogebra.js`.
|
|
137
38
|
|
|
39
|
+
## `WebwriterGeogebra` (`<webwriter-geogebra>`)
|
|
138
40
|
|
|
139
|
-
|
|
140
|
-
A GeoGebra Geometry widget.
|
|
41
|
+
GeoGebra Calculator Suite (type "suite"): learners switch between GeoGebra's graphing, geometry, 3D and CAS calculators in one applet; use it for open exploration. Load a construction with `src` or leave it out for a blank app.
|
|
141
42
|
|
|
142
|
-
|
|
43
|
+
Unlike the other tags, it has no undo and redo buttons (its `ggbstyles` hide them) and `enablefilefeatures` defaults to "false".
|
|
143
44
|
|
|
144
|
-
|
|
145
|
-
```html
|
|
146
|
-
<link href="https://cdn.jsdelivr.net/npm/@webwriter/geogebra/widgets/webwriter-geogebra-geometry.css" rel="stylesheet">
|
|
147
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@webwriter/geogebra/widgets/webwriter-geogebra-geometry.js"></script>
|
|
148
|
-
<webwriter-geogebra-geometry></webwriter-geogebra-geometry>
|
|
149
|
-
```
|
|
45
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
150
46
|
|
|
151
|
-
|
|
47
|
+
**Data block:** The edited or imported construction.
|
|
152
48
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
```
|
|
49
|
+
<details>
|
|
50
|
+
<summary>JSON Schema</summary>
|
|
156
51
|
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
55
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
56
|
+
"title": "GeoGebra construction",
|
|
57
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
58
|
+
"type": "object",
|
|
59
|
+
"properties": {
|
|
60
|
+
"src": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^data:[^,]*;base64,",
|
|
63
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
161
67
|
```
|
|
162
68
|
|
|
163
|
-
|
|
164
|
-
| Name (Attribute Name) | Type | Description | Default | Reflects |
|
|
165
|
-
| :-------------------: | :--: | :---------: | :-----: | :------: |
|
|
166
|
-
| `type` (`type`) | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | app name, default: "classic". "graphing" … GeoGebra Graphing Calculator "geometry" … GeoGebra Geometry "3d" … GeoGebra 3D Graphing Calculator "classic" … GeoGebra Classic "suite" … GeoGebra Calculator Suite "evaluator" … Equation Editor "scientific" …Scientific Calculator "notes" … GeoGebra Notes | `"geometry"` | ✓ |
|
|
167
|
-
| `showZoomButtons` (`showZoomButtons`) | `boolean` | States whether the zoom in / zoom out / home buttons should be shown in the Graphics View or not. Default: false | `true` | ✓ |
|
|
168
|
-
| `showFullscreenButton` (`showFullscreenButton`) | `boolean` | Whether fullscreen button should be visible | `true` | ✓ |
|
|
169
|
-
| `WebwriterGeogebraGeometry.options` | - | - | `geogebraOptions` | ✗ |
|
|
170
|
-
| `WebwriterGeogebraGeometry.actions` | `object` | - | `{ importConstruction: { label: (widget: {msg: MsgFn}) => ({_: widget.msg("Import construction")}), input: {type: "file" as const, accept: ".ggb", multiple: false}, }, }` | ✗ |
|
|
171
|
-
| `WebwriterGeogebraGeometry.convertFrom` | `object` | - | `{".ggb": "importGgb"}` | ✗ |
|
|
172
|
-
| `WebwriterGeogebraGeometry.convertTo` | `object` | - | `{".ggb": "exportGgb", "image/png": "exportPng", "image/svg+xml": "exportSvg"}` | ✗ |
|
|
173
|
-
| `msg` | `MsgFn` | - | - | ✗ |
|
|
174
|
-
| `ggbStyles` (`ggbStyles`) | `string` | Custom CSS styles to apply to the GeoGebra applet. | - | ✗ |
|
|
175
|
-
| `width` (`width`) | `number` | Applet width | `800` | ✓ |
|
|
176
|
-
| `height` (`height`) | `number` | Applet height | `450` | ✓ |
|
|
177
|
-
| `src` (`src`) | `string \| undefined` | Source of the GeoGebra file to load (base64-encoded string, material ID prefixed with "ggbid:", or file URL) | - | ✓ |
|
|
178
|
-
| `borderColor` (`borderColor`) | `string` | Color of the border line drawn around the applet panel (as hex rgb string). Default: gray | `"gray"` | ✓ |
|
|
179
|
-
| `borderRadius` (`borderRadius`) | `number` | Size of applet's border radius in pixels. | `1` | ✓ |
|
|
180
|
-
| `enableRightClick` (`enableRightClick`) | `boolean` | States whether right clicks should be handled by the applet. Setting this parameter to "false" disables context menus, properties dialogs and right-click-zooming. Default: true. NB also enables/disables some keyboard shortcuts eg Delete and Ctrl + R (recompute all objects). Default: true | `true` | ✓ |
|
|
181
|
-
| `enableLabelDrags` (`enableLabelDrags`) | `boolean` | States whether labels can be dragged. Default: true | `true` | ✓ |
|
|
182
|
-
| `enableShiftDragZoom` (`enableShiftDragZoom`) | `boolean` | States whether the Graphics View(s) should be moveable using Shift mouse drag (or. Ctrl + mouse drag) or zoomable using Shift + mouse wheel (or Ctrl + mouse wheel). Setting this parameter to "false" disables moving and zooming of the drawing pad. Default: true | `true` | ✓ |
|
|
183
|
-
| `errorDialogsActive` (`errorDialogsActive`) | `boolean` | States whether error dialogs will be shown if an invalid input is entered (using the Input Bar or JavaScript) Default: true | `true` | ✓ |
|
|
184
|
-
| `showMenuBar` (`showMenuBar`) | `boolean` | States whether the menubar of GeoGebra should be shown in the applet. Default: false | `false` | ✓ |
|
|
185
|
-
| `showToolBar` (`showToolBar`) | `boolean` | States whether the toolbar with the construction mode buttons should be shown in the applet. Default: false | `true` | ✓ |
|
|
186
|
-
| `showToolBarHelp` (`showToolBarHelp`) | `boolean` | States whether the toolbar help text right to the toolbar buttons should be shown in the applet | `false` | ✓ |
|
|
187
|
-
| `customToolBar` (`customToolBar`) | `string \| undefined` | Sets the toolbar according to a custom toolbar string where the int values are Toolbar Mode Values, `,` adds a separator within a menu, `\|` starts a new menu and `\|\|` adds a separator in the toolbar before starting a new menu. This will override the saved toolbar from the .ggb file / base64 string. Custom tools are numbered 100 001, 100 002, etc | - | ✓ |
|
|
188
|
-
| `showAlgebraInput` (`showAlgebraInput`) | `boolean` | States whether the algebra input line (with input field, greek letters and command list) should be shown in the applet. Default: false | `true` | ✓ |
|
|
189
|
-
| `showResetIcon` (`showResetIcon`) | `boolean` | States whether a small icon (GeoGebra ellipse) should be shown in the upper right corner of the applet. Clicking on this icon resets the applet (i.e. it reloads the file given in the filename parameter). Default: false | `false` | ✓ |
|
|
190
|
-
| `language` (`language`) | `string \| undefined` | ISO language string. GeoGebra tries to set your local language automatically (if it is available among the supported languages, of course). The default language for unsupported languages is English. If you want to specify a certain language manually, please use this parameter. | - | ✓ |
|
|
191
|
-
| `country` (`country`) | `string \| undefined` | ISO country string. This parameter only makes sense if you use it together with the language parameter. | - | ✓ |
|
|
192
|
-
| `appletId` (`appletId`) | `string \| undefined` | This parameter allows you to specify the argument passed to the JavaScript function ggbOnInit(), which is called once the applet is fully initialised. This is useful when you have multiple applets on a page. | - | ✓ |
|
|
193
|
-
| `allowStyleBar` (`allowStyleBar`) | `boolean` | Determines whether the Style Bar can be shown (or will be shown if just Graphics View 1 is showing). Default: false | `false` | ✓ |
|
|
194
|
-
| `randomize` (`randomize`) | `boolean` | Determines whether random numbers should be randomized on file load. Useful when you want the app to reload in exactly the same state it was saved. Default: true | `true` | ✓ |
|
|
195
|
-
| `randomSeed` (`randomSeed`) | `number \| undefined` | Specify seed for random numbers. Note that if you save a state of the app after user interacted with it and try to reload that state with the same randomSeed, you may get a different result. Use randomize for those use-cases. | - | ✓ |
|
|
196
|
-
| `useBrowserForJs` (`useBrowserForJs`) | `boolean` | When true, GeoGebra: runs ggbOnInit from HTML, ignores ggbOnInit from file, and ignores JS update scripts of objects in file. When false, GeoGebra: ignores ggbOnInit from HTML (use appletOnLoad parameter of GGBApplet instead), runs ggbOnInit from file, and runs JS update scripts of objects in file. Default: false | `false` | ✓ |
|
|
197
|
-
| `showLogging` (`showLogging`) | `boolean` | Determines whether logging is shown in the Browser's console. Default: false | `false` | ✓ |
|
|
198
|
-
| `capturingThreshold` (`capturingThreshold`) | `number` | Determines the sensitivity of object selection. The default value of 3 is usually fine to select and drag objects both with the mouse and touch. Use larger values (e.g. 4 or 5) to make it easier to select and drag objects. Default: 3 | `3` | ✓ |
|
|
199
|
-
| `enableFileFeatures` (`enableFileFeatures`) | `boolean` | Determines whether file saving, file loading, sign in and Options > Save settings are enabled. This argument is ignored when menubar is not showing. Default: true | `true` | ✓ |
|
|
200
|
-
| `enableUndoRedo` (`enableUndoRedo`) | `boolean` | Determines whether Undo and Redo icons are shown. This argument is ignored when toolbar is not showing. Default: true | `true` | ✓ |
|
|
201
|
-
| `perspective` (`perspective`) | `string \| undefined` | For values see SetPerspective_Command in the GeoGebra Manual. Just for a blank start ie shouldn't be used with material_id, filename or ggbBase64 parameters | - | ✓ |
|
|
202
|
-
| `enable3d` (`enable3d`) | `boolean \| undefined` | Whether 3D should be enabled (for exam mode). | - | ✓ |
|
|
203
|
-
| `enableCAS` (`enableCAS`) | `boolean \| undefined` | Whether CAS should be enabled (for exam mode). | - | ✓ |
|
|
204
|
-
| `algebraInputPosition` (`algebraInputPosition`) | `"algebra" \| "top" \| "bottom" \| undefined` | Determines whether input bar should be shown in algebra, on top of the applet or under the applet. When left empty (default), the position depends on file. | - | ✓ |
|
|
205
|
-
| `preventFocus` (`preventFocus`) | `boolean` | When set to true, this prevents the applet from getting focus automatically at the start. Default: false | `false` | ✓ |
|
|
206
|
-
| `scaleContainerClass` (`scaleContainerClass`) | `string \| undefined` | Name of CSS class that is used as container; applet will scale to fit into the container. | - | ✓ |
|
|
207
|
-
| `autoHeight` (`autoHeight`) | `boolean` | `true` to restrict the width of the applet and compute height automatically, add autoHeight: true. `false` if you want the applet to be restricted by both width and height of the container | `true` | ✓ |
|
|
208
|
-
| `allowUpscale` (`allowUpscale`) | `boolean` | Determines whether automatic scaling may scale the applet up. Default: false | `false` | ✓ |
|
|
209
|
-
| `playButton` (`playButton`) | `boolean` | Determines whether a preview image and a play button should be rendered in place of the applet. Pushing the play button initializes the applet. Default: false | `false` | ✓ |
|
|
210
|
-
| `scale` (`scale`) | `number` | Ratio by which the applet should be scaled (eg. 2 makes the applet 2 times bigger, including all texts and UI elements). Default: 1 | `1` | ✓ |
|
|
211
|
-
| `showAnimationButton` (`showAnimationButton`) | `boolean` | Whether animation button should be visible | `false` | ✓ |
|
|
212
|
-
| `showSuggestionButtons` (`showSuggestionButtons`) | `boolean` | Whether suggestion buttons (special points, solve) in Algebra View should be visible | `false` | ✓ |
|
|
213
|
-
| `showStartTooltip` (`showStartTooltip`) | `boolean` | Whether "Welcome" tooltip should be shown | `false` | ✓ |
|
|
214
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
215
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
216
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
217
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
218
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
219
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
220
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
221
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
222
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
223
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
224
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
225
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
226
|
-
|
|
227
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
228
|
-
|
|
229
|
-
## Methods
|
|
230
|
-
| Name | Description | Parameters |
|
|
231
|
-
| :--: | :---------: | :-------: |
|
|
232
|
-
| `importConstruction` | - | `files: File[]`
|
|
233
|
-
| `importGgb` | - | `file: File`
|
|
234
|
-
| `exportGgb` | - | -
|
|
235
|
-
| `exportPng` | - | -
|
|
236
|
-
| `exportSvg` | - | -
|
|
237
|
-
| `focus` | - | `options: FocusOptions`
|
|
238
|
-
|
|
239
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
240
|
-
|
|
241
|
-
## Events
|
|
242
|
-
| Name | Description |
|
|
243
|
-
| :--: | :---------: |
|
|
244
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
245
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
246
|
-
|
|
247
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
248
|
-
|
|
249
|
-
## CSS parts
|
|
250
|
-
| Name | Description |
|
|
251
|
-
| :--: | :---------: |
|
|
252
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
253
|
-
|
|
254
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
255
|
-
|
|
256
|
-
## Editing config
|
|
257
|
-
| Name | Value |
|
|
258
|
-
| :--: | :---------: |
|
|
259
|
-
| `content` | `text*` |
|
|
260
|
-
| `importFormats` | `.ggb` |
|
|
261
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
262
|
-
|
|
263
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
264
|
-
|
|
265
|
-
*No public slots, or custom CSS properties.*
|
|
69
|
+
</details>
|
|
266
70
|
|
|
71
|
+
**Events:**
|
|
72
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
73
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
267
74
|
|
|
268
|
-
|
|
269
|
-
|
|
75
|
+
**CSS parts:**
|
|
76
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
270
77
|
|
|
271
|
-
|
|
78
|
+
**CSS properties:**
|
|
79
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
80
|
+
- `--ww-font-family`: Font of the widget.
|
|
81
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
272
82
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
83
|
+
**Methods:**
|
|
84
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
85
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
86
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
87
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
88
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
89
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
279
90
|
|
|
280
|
-
|
|
91
|
+
**Editing config:** `label: Geogebra` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
281
92
|
|
|
282
|
-
|
|
283
|
-
npm install @webwriter/geogebra
|
|
284
|
-
```
|
|
93
|
+
## `WebwriterGeogebraGeometry` (`<webwriter-geogebra-geometry>`)
|
|
285
94
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
95
|
+
GeoGebra Geometry (type "geometry"): ruler-and-compass constructions with points, lines, circles, polygons and angles; use it for tasks such as constructing a perpendicular bisector. Load a construction with `src` or leave it out for a blank sheet.
|
|
96
|
+
|
|
97
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
98
|
+
|
|
99
|
+
**Data block:** The edited or imported construction.
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
<summary>JSON Schema</summary>
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
107
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
108
|
+
"title": "GeoGebra construction",
|
|
109
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"src": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"pattern": "^data:[^,]*;base64,",
|
|
115
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
290
119
|
```
|
|
291
120
|
|
|
292
|
-
|
|
293
|
-
| Name (Attribute Name) | Type | Description | Default | Reflects |
|
|
294
|
-
| :-------------------: | :--: | :---------: | :-----: | :------: |
|
|
295
|
-
| `type` (`type`) | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | app name, default: "classic". "graphing" … GeoGebra Graphing Calculator "geometry" … GeoGebra Geometry "3d" … GeoGebra 3D Graphing Calculator "classic" … GeoGebra Classic "suite" … GeoGebra Calculator Suite "evaluator" … Equation Editor "scientific" …Scientific Calculator "notes" … GeoGebra Notes | `"3d"` | ✓ |
|
|
296
|
-
| `showZoomButtons` (`showZoomButtons`) | `boolean` | States whether the zoom in / zoom out / home buttons should be shown in the Graphics View or not. Default: false | `true` | ✓ |
|
|
297
|
-
| `showFullscreenButton` (`showFullscreenButton`) | `boolean` | Whether fullscreen button should be visible | `true` | ✓ |
|
|
298
|
-
| `WebwriterGeogebra3d.options` | - | - | `geogebraOptions` | ✗ |
|
|
299
|
-
| `WebwriterGeogebra3d.actions` | `object` | - | `{ importConstruction: { label: (widget: {msg: MsgFn}) => ({_: widget.msg("Import construction")}), input: {type: "file" as const, accept: ".ggb", multiple: false}, }, }` | ✗ |
|
|
300
|
-
| `WebwriterGeogebra3d.convertFrom` | `object` | - | `{".ggb": "importGgb"}` | ✗ |
|
|
301
|
-
| `WebwriterGeogebra3d.convertTo` | `object` | - | `{".ggb": "exportGgb", "image/png": "exportPng", "image/svg+xml": "exportSvg"}` | ✗ |
|
|
302
|
-
| `msg` | `MsgFn` | - | - | ✗ |
|
|
303
|
-
| `ggbStyles` (`ggbStyles`) | `string` | Custom CSS styles to apply to the GeoGebra applet. | - | ✗ |
|
|
304
|
-
| `width` (`width`) | `number` | Applet width | `800` | ✓ |
|
|
305
|
-
| `height` (`height`) | `number` | Applet height | `450` | ✓ |
|
|
306
|
-
| `src` (`src`) | `string \| undefined` | Source of the GeoGebra file to load (base64-encoded string, material ID prefixed with "ggbid:", or file URL) | - | ✓ |
|
|
307
|
-
| `borderColor` (`borderColor`) | `string` | Color of the border line drawn around the applet panel (as hex rgb string). Default: gray | `"gray"` | ✓ |
|
|
308
|
-
| `borderRadius` (`borderRadius`) | `number` | Size of applet's border radius in pixels. | `1` | ✓ |
|
|
309
|
-
| `enableRightClick` (`enableRightClick`) | `boolean` | States whether right clicks should be handled by the applet. Setting this parameter to "false" disables context menus, properties dialogs and right-click-zooming. Default: true. NB also enables/disables some keyboard shortcuts eg Delete and Ctrl + R (recompute all objects). Default: true | `true` | ✓ |
|
|
310
|
-
| `enableLabelDrags` (`enableLabelDrags`) | `boolean` | States whether labels can be dragged. Default: true | `true` | ✓ |
|
|
311
|
-
| `enableShiftDragZoom` (`enableShiftDragZoom`) | `boolean` | States whether the Graphics View(s) should be moveable using Shift mouse drag (or. Ctrl + mouse drag) or zoomable using Shift + mouse wheel (or Ctrl + mouse wheel). Setting this parameter to "false" disables moving and zooming of the drawing pad. Default: true | `true` | ✓ |
|
|
312
|
-
| `errorDialogsActive` (`errorDialogsActive`) | `boolean` | States whether error dialogs will be shown if an invalid input is entered (using the Input Bar or JavaScript) Default: true | `true` | ✓ |
|
|
313
|
-
| `showMenuBar` (`showMenuBar`) | `boolean` | States whether the menubar of GeoGebra should be shown in the applet. Default: false | `false` | ✓ |
|
|
314
|
-
| `showToolBar` (`showToolBar`) | `boolean` | States whether the toolbar with the construction mode buttons should be shown in the applet. Default: false | `true` | ✓ |
|
|
315
|
-
| `showToolBarHelp` (`showToolBarHelp`) | `boolean` | States whether the toolbar help text right to the toolbar buttons should be shown in the applet | `false` | ✓ |
|
|
316
|
-
| `customToolBar` (`customToolBar`) | `string \| undefined` | Sets the toolbar according to a custom toolbar string where the int values are Toolbar Mode Values, `,` adds a separator within a menu, `\|` starts a new menu and `\|\|` adds a separator in the toolbar before starting a new menu. This will override the saved toolbar from the .ggb file / base64 string. Custom tools are numbered 100 001, 100 002, etc | - | ✓ |
|
|
317
|
-
| `showAlgebraInput` (`showAlgebraInput`) | `boolean` | States whether the algebra input line (with input field, greek letters and command list) should be shown in the applet. Default: false | `true` | ✓ |
|
|
318
|
-
| `showResetIcon` (`showResetIcon`) | `boolean` | States whether a small icon (GeoGebra ellipse) should be shown in the upper right corner of the applet. Clicking on this icon resets the applet (i.e. it reloads the file given in the filename parameter). Default: false | `false` | ✓ |
|
|
319
|
-
| `language` (`language`) | `string \| undefined` | ISO language string. GeoGebra tries to set your local language automatically (if it is available among the supported languages, of course). The default language for unsupported languages is English. If you want to specify a certain language manually, please use this parameter. | - | ✓ |
|
|
320
|
-
| `country` (`country`) | `string \| undefined` | ISO country string. This parameter only makes sense if you use it together with the language parameter. | - | ✓ |
|
|
321
|
-
| `appletId` (`appletId`) | `string \| undefined` | This parameter allows you to specify the argument passed to the JavaScript function ggbOnInit(), which is called once the applet is fully initialised. This is useful when you have multiple applets on a page. | - | ✓ |
|
|
322
|
-
| `allowStyleBar` (`allowStyleBar`) | `boolean` | Determines whether the Style Bar can be shown (or will be shown if just Graphics View 1 is showing). Default: false | `false` | ✓ |
|
|
323
|
-
| `randomize` (`randomize`) | `boolean` | Determines whether random numbers should be randomized on file load. Useful when you want the app to reload in exactly the same state it was saved. Default: true | `true` | ✓ |
|
|
324
|
-
| `randomSeed` (`randomSeed`) | `number \| undefined` | Specify seed for random numbers. Note that if you save a state of the app after user interacted with it and try to reload that state with the same randomSeed, you may get a different result. Use randomize for those use-cases. | - | ✓ |
|
|
325
|
-
| `useBrowserForJs` (`useBrowserForJs`) | `boolean` | When true, GeoGebra: runs ggbOnInit from HTML, ignores ggbOnInit from file, and ignores JS update scripts of objects in file. When false, GeoGebra: ignores ggbOnInit from HTML (use appletOnLoad parameter of GGBApplet instead), runs ggbOnInit from file, and runs JS update scripts of objects in file. Default: false | `false` | ✓ |
|
|
326
|
-
| `showLogging` (`showLogging`) | `boolean` | Determines whether logging is shown in the Browser's console. Default: false | `false` | ✓ |
|
|
327
|
-
| `capturingThreshold` (`capturingThreshold`) | `number` | Determines the sensitivity of object selection. The default value of 3 is usually fine to select and drag objects both with the mouse and touch. Use larger values (e.g. 4 or 5) to make it easier to select and drag objects. Default: 3 | `3` | ✓ |
|
|
328
|
-
| `enableFileFeatures` (`enableFileFeatures`) | `boolean` | Determines whether file saving, file loading, sign in and Options > Save settings are enabled. This argument is ignored when menubar is not showing. Default: true | `true` | ✓ |
|
|
329
|
-
| `enableUndoRedo` (`enableUndoRedo`) | `boolean` | Determines whether Undo and Redo icons are shown. This argument is ignored when toolbar is not showing. Default: true | `true` | ✓ |
|
|
330
|
-
| `perspective` (`perspective`) | `string \| undefined` | For values see SetPerspective_Command in the GeoGebra Manual. Just for a blank start ie shouldn't be used with material_id, filename or ggbBase64 parameters | - | ✓ |
|
|
331
|
-
| `enable3d` (`enable3d`) | `boolean \| undefined` | Whether 3D should be enabled (for exam mode). | - | ✓ |
|
|
332
|
-
| `enableCAS` (`enableCAS`) | `boolean \| undefined` | Whether CAS should be enabled (for exam mode). | - | ✓ |
|
|
333
|
-
| `algebraInputPosition` (`algebraInputPosition`) | `"algebra" \| "top" \| "bottom" \| undefined` | Determines whether input bar should be shown in algebra, on top of the applet or under the applet. When left empty (default), the position depends on file. | - | ✓ |
|
|
334
|
-
| `preventFocus` (`preventFocus`) | `boolean` | When set to true, this prevents the applet from getting focus automatically at the start. Default: false | `false` | ✓ |
|
|
335
|
-
| `scaleContainerClass` (`scaleContainerClass`) | `string \| undefined` | Name of CSS class that is used as container; applet will scale to fit into the container. | - | ✓ |
|
|
336
|
-
| `autoHeight` (`autoHeight`) | `boolean` | `true` to restrict the width of the applet and compute height automatically, add autoHeight: true. `false` if you want the applet to be restricted by both width and height of the container | `true` | ✓ |
|
|
337
|
-
| `allowUpscale` (`allowUpscale`) | `boolean` | Determines whether automatic scaling may scale the applet up. Default: false | `false` | ✓ |
|
|
338
|
-
| `playButton` (`playButton`) | `boolean` | Determines whether a preview image and a play button should be rendered in place of the applet. Pushing the play button initializes the applet. Default: false | `false` | ✓ |
|
|
339
|
-
| `scale` (`scale`) | `number` | Ratio by which the applet should be scaled (eg. 2 makes the applet 2 times bigger, including all texts and UI elements). Default: 1 | `1` | ✓ |
|
|
340
|
-
| `showAnimationButton` (`showAnimationButton`) | `boolean` | Whether animation button should be visible | `false` | ✓ |
|
|
341
|
-
| `showSuggestionButtons` (`showSuggestionButtons`) | `boolean` | Whether suggestion buttons (special points, solve) in Algebra View should be visible | `false` | ✓ |
|
|
342
|
-
| `showStartTooltip` (`showStartTooltip`) | `boolean` | Whether "Welcome" tooltip should be shown | `false` | ✓ |
|
|
343
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
344
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
345
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
346
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
347
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
348
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
349
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
350
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
351
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
352
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
353
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
354
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
355
|
-
|
|
356
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
357
|
-
|
|
358
|
-
## Methods
|
|
359
|
-
| Name | Description | Parameters |
|
|
360
|
-
| :--: | :---------: | :-------: |
|
|
361
|
-
| `importConstruction` | - | `files: File[]`
|
|
362
|
-
| `importGgb` | - | `file: File`
|
|
363
|
-
| `exportGgb` | - | -
|
|
364
|
-
| `exportPng` | - | -
|
|
365
|
-
| `exportSvg` | - | -
|
|
366
|
-
| `focus` | - | `options: FocusOptions`
|
|
367
|
-
|
|
368
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
369
|
-
|
|
370
|
-
## Events
|
|
371
|
-
| Name | Description |
|
|
372
|
-
| :--: | :---------: |
|
|
373
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
374
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
375
|
-
|
|
376
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
377
|
-
|
|
378
|
-
## CSS parts
|
|
379
|
-
| Name | Description |
|
|
380
|
-
| :--: | :---------: |
|
|
381
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
382
|
-
|
|
383
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
384
|
-
|
|
385
|
-
## Editing config
|
|
386
|
-
| Name | Value |
|
|
387
|
-
| :--: | :---------: |
|
|
388
|
-
| `content` | `text*` |
|
|
389
|
-
| `importFormats` | `.ggb` |
|
|
390
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
391
|
-
|
|
392
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
393
|
-
|
|
394
|
-
*No public slots, or custom CSS properties.*
|
|
121
|
+
</details>
|
|
395
122
|
|
|
123
|
+
**Events:**
|
|
124
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
125
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
396
126
|
|
|
397
|
-
|
|
398
|
-
|
|
127
|
+
**CSS parts:**
|
|
128
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
399
129
|
|
|
400
|
-
|
|
130
|
+
**CSS properties:**
|
|
131
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
132
|
+
- `--ww-font-family`: Font of the widget.
|
|
133
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
401
134
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
135
|
+
**Methods:**
|
|
136
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
137
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
138
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
139
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
140
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
141
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
408
142
|
|
|
409
|
-
|
|
143
|
+
**Editing config:** `label: Geogebra Geometry` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
410
144
|
|
|
411
|
-
|
|
412
|
-
npm install @webwriter/geogebra
|
|
413
|
-
```
|
|
145
|
+
## `WebwriterGeogebra3d` (`<webwriter-geogebra-3d>`)
|
|
414
146
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
147
|
+
GeoGebra 3D Graphing Calculator (type "3d"): plot surfaces, planes, solids and points in space and rotate the view; use it for spatial geometry and functions of two variables. Load a construction with `src` or leave it out for an empty 3D view.
|
|
148
|
+
|
|
149
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
150
|
+
|
|
151
|
+
**Data block:** The edited or imported construction.
|
|
152
|
+
|
|
153
|
+
<details>
|
|
154
|
+
<summary>JSON Schema</summary>
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
159
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
160
|
+
"title": "GeoGebra construction",
|
|
161
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
162
|
+
"type": "object",
|
|
163
|
+
"properties": {
|
|
164
|
+
"src": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"pattern": "^data:[^,]*;base64,",
|
|
167
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
419
171
|
```
|
|
420
172
|
|
|
421
|
-
|
|
422
|
-
| Name (Attribute Name) | Type | Description | Default | Reflects |
|
|
423
|
-
| :-------------------: | :--: | :---------: | :-----: | :------: |
|
|
424
|
-
| `type` (`type`) | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | app name, default: "classic". "graphing" … GeoGebra Graphing Calculator "geometry" … GeoGebra Geometry "3d" … GeoGebra 3D Graphing Calculator "classic" … GeoGebra Classic "suite" … GeoGebra Calculator Suite "evaluator" … Equation Editor "scientific" …Scientific Calculator "notes" … GeoGebra Notes | `"notes"` | ✓ |
|
|
425
|
-
| `showZoomButtons` (`showZoomButtons`) | `boolean` | States whether the zoom in / zoom out / home buttons should be shown in the Graphics View or not. Default: false | `true` | ✓ |
|
|
426
|
-
| `showFullscreenButton` (`showFullscreenButton`) | `boolean` | Whether fullscreen button should be visible | `true` | ✓ |
|
|
427
|
-
| `WebwriterGeogebraNotes.options` | - | - | `geogebraOptions` | ✗ |
|
|
428
|
-
| `WebwriterGeogebraNotes.actions` | `object` | - | `{ importConstruction: { label: (widget: {msg: MsgFn}) => ({_: widget.msg("Import construction")}), input: {type: "file" as const, accept: ".ggb", multiple: false}, }, }` | ✗ |
|
|
429
|
-
| `WebwriterGeogebraNotes.convertFrom` | `object` | - | `{".ggb": "importGgb"}` | ✗ |
|
|
430
|
-
| `WebwriterGeogebraNotes.convertTo` | `object` | - | `{".ggb": "exportGgb", "image/png": "exportPng", "image/svg+xml": "exportSvg"}` | ✗ |
|
|
431
|
-
| `msg` | `MsgFn` | - | - | ✗ |
|
|
432
|
-
| `ggbStyles` (`ggbStyles`) | `string` | Custom CSS styles to apply to the GeoGebra applet. | - | ✗ |
|
|
433
|
-
| `width` (`width`) | `number` | Applet width | `800` | ✓ |
|
|
434
|
-
| `height` (`height`) | `number` | Applet height | `450` | ✓ |
|
|
435
|
-
| `src` (`src`) | `string \| undefined` | Source of the GeoGebra file to load (base64-encoded string, material ID prefixed with "ggbid:", or file URL) | - | ✓ |
|
|
436
|
-
| `borderColor` (`borderColor`) | `string` | Color of the border line drawn around the applet panel (as hex rgb string). Default: gray | `"gray"` | ✓ |
|
|
437
|
-
| `borderRadius` (`borderRadius`) | `number` | Size of applet's border radius in pixels. | `1` | ✓ |
|
|
438
|
-
| `enableRightClick` (`enableRightClick`) | `boolean` | States whether right clicks should be handled by the applet. Setting this parameter to "false" disables context menus, properties dialogs and right-click-zooming. Default: true. NB also enables/disables some keyboard shortcuts eg Delete and Ctrl + R (recompute all objects). Default: true | `true` | ✓ |
|
|
439
|
-
| `enableLabelDrags` (`enableLabelDrags`) | `boolean` | States whether labels can be dragged. Default: true | `true` | ✓ |
|
|
440
|
-
| `enableShiftDragZoom` (`enableShiftDragZoom`) | `boolean` | States whether the Graphics View(s) should be moveable using Shift mouse drag (or. Ctrl + mouse drag) or zoomable using Shift + mouse wheel (or Ctrl + mouse wheel). Setting this parameter to "false" disables moving and zooming of the drawing pad. Default: true | `true` | ✓ |
|
|
441
|
-
| `errorDialogsActive` (`errorDialogsActive`) | `boolean` | States whether error dialogs will be shown if an invalid input is entered (using the Input Bar or JavaScript) Default: true | `true` | ✓ |
|
|
442
|
-
| `showMenuBar` (`showMenuBar`) | `boolean` | States whether the menubar of GeoGebra should be shown in the applet. Default: false | `false` | ✓ |
|
|
443
|
-
| `showToolBar` (`showToolBar`) | `boolean` | States whether the toolbar with the construction mode buttons should be shown in the applet. Default: false | `true` | ✓ |
|
|
444
|
-
| `showToolBarHelp` (`showToolBarHelp`) | `boolean` | States whether the toolbar help text right to the toolbar buttons should be shown in the applet | `false` | ✓ |
|
|
445
|
-
| `customToolBar` (`customToolBar`) | `string \| undefined` | Sets the toolbar according to a custom toolbar string where the int values are Toolbar Mode Values, `,` adds a separator within a menu, `\|` starts a new menu and `\|\|` adds a separator in the toolbar before starting a new menu. This will override the saved toolbar from the .ggb file / base64 string. Custom tools are numbered 100 001, 100 002, etc | - | ✓ |
|
|
446
|
-
| `showAlgebraInput` (`showAlgebraInput`) | `boolean` | States whether the algebra input line (with input field, greek letters and command list) should be shown in the applet. Default: false | `true` | ✓ |
|
|
447
|
-
| `showResetIcon` (`showResetIcon`) | `boolean` | States whether a small icon (GeoGebra ellipse) should be shown in the upper right corner of the applet. Clicking on this icon resets the applet (i.e. it reloads the file given in the filename parameter). Default: false | `false` | ✓ |
|
|
448
|
-
| `language` (`language`) | `string \| undefined` | ISO language string. GeoGebra tries to set your local language automatically (if it is available among the supported languages, of course). The default language for unsupported languages is English. If you want to specify a certain language manually, please use this parameter. | - | ✓ |
|
|
449
|
-
| `country` (`country`) | `string \| undefined` | ISO country string. This parameter only makes sense if you use it together with the language parameter. | - | ✓ |
|
|
450
|
-
| `appletId` (`appletId`) | `string \| undefined` | This parameter allows you to specify the argument passed to the JavaScript function ggbOnInit(), which is called once the applet is fully initialised. This is useful when you have multiple applets on a page. | - | ✓ |
|
|
451
|
-
| `allowStyleBar` (`allowStyleBar`) | `boolean` | Determines whether the Style Bar can be shown (or will be shown if just Graphics View 1 is showing). Default: false | `false` | ✓ |
|
|
452
|
-
| `randomize` (`randomize`) | `boolean` | Determines whether random numbers should be randomized on file load. Useful when you want the app to reload in exactly the same state it was saved. Default: true | `true` | ✓ |
|
|
453
|
-
| `randomSeed` (`randomSeed`) | `number \| undefined` | Specify seed for random numbers. Note that if you save a state of the app after user interacted with it and try to reload that state with the same randomSeed, you may get a different result. Use randomize for those use-cases. | - | ✓ |
|
|
454
|
-
| `useBrowserForJs` (`useBrowserForJs`) | `boolean` | When true, GeoGebra: runs ggbOnInit from HTML, ignores ggbOnInit from file, and ignores JS update scripts of objects in file. When false, GeoGebra: ignores ggbOnInit from HTML (use appletOnLoad parameter of GGBApplet instead), runs ggbOnInit from file, and runs JS update scripts of objects in file. Default: false | `false` | ✓ |
|
|
455
|
-
| `showLogging` (`showLogging`) | `boolean` | Determines whether logging is shown in the Browser's console. Default: false | `false` | ✓ |
|
|
456
|
-
| `capturingThreshold` (`capturingThreshold`) | `number` | Determines the sensitivity of object selection. The default value of 3 is usually fine to select and drag objects both with the mouse and touch. Use larger values (e.g. 4 or 5) to make it easier to select and drag objects. Default: 3 | `3` | ✓ |
|
|
457
|
-
| `enableFileFeatures` (`enableFileFeatures`) | `boolean` | Determines whether file saving, file loading, sign in and Options > Save settings are enabled. This argument is ignored when menubar is not showing. Default: true | `true` | ✓ |
|
|
458
|
-
| `enableUndoRedo` (`enableUndoRedo`) | `boolean` | Determines whether Undo and Redo icons are shown. This argument is ignored when toolbar is not showing. Default: true | `true` | ✓ |
|
|
459
|
-
| `perspective` (`perspective`) | `string \| undefined` | For values see SetPerspective_Command in the GeoGebra Manual. Just for a blank start ie shouldn't be used with material_id, filename or ggbBase64 parameters | - | ✓ |
|
|
460
|
-
| `enable3d` (`enable3d`) | `boolean \| undefined` | Whether 3D should be enabled (for exam mode). | - | ✓ |
|
|
461
|
-
| `enableCAS` (`enableCAS`) | `boolean \| undefined` | Whether CAS should be enabled (for exam mode). | - | ✓ |
|
|
462
|
-
| `algebraInputPosition` (`algebraInputPosition`) | `"algebra" \| "top" \| "bottom" \| undefined` | Determines whether input bar should be shown in algebra, on top of the applet or under the applet. When left empty (default), the position depends on file. | - | ✓ |
|
|
463
|
-
| `preventFocus` (`preventFocus`) | `boolean` | When set to true, this prevents the applet from getting focus automatically at the start. Default: false | `false` | ✓ |
|
|
464
|
-
| `scaleContainerClass` (`scaleContainerClass`) | `string \| undefined` | Name of CSS class that is used as container; applet will scale to fit into the container. | - | ✓ |
|
|
465
|
-
| `autoHeight` (`autoHeight`) | `boolean` | `true` to restrict the width of the applet and compute height automatically, add autoHeight: true. `false` if you want the applet to be restricted by both width and height of the container | `true` | ✓ |
|
|
466
|
-
| `allowUpscale` (`allowUpscale`) | `boolean` | Determines whether automatic scaling may scale the applet up. Default: false | `false` | ✓ |
|
|
467
|
-
| `playButton` (`playButton`) | `boolean` | Determines whether a preview image and a play button should be rendered in place of the applet. Pushing the play button initializes the applet. Default: false | `false` | ✓ |
|
|
468
|
-
| `scale` (`scale`) | `number` | Ratio by which the applet should be scaled (eg. 2 makes the applet 2 times bigger, including all texts and UI elements). Default: 1 | `1` | ✓ |
|
|
469
|
-
| `showAnimationButton` (`showAnimationButton`) | `boolean` | Whether animation button should be visible | `false` | ✓ |
|
|
470
|
-
| `showSuggestionButtons` (`showSuggestionButtons`) | `boolean` | Whether suggestion buttons (special points, solve) in Algebra View should be visible | `false` | ✓ |
|
|
471
|
-
| `showStartTooltip` (`showStartTooltip`) | `boolean` | Whether "Welcome" tooltip should be shown | `false` | ✓ |
|
|
472
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
473
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
474
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
475
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
476
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
477
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
478
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
479
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
480
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
481
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
482
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
483
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
484
|
-
|
|
485
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
486
|
-
|
|
487
|
-
## Methods
|
|
488
|
-
| Name | Description | Parameters |
|
|
489
|
-
| :--: | :---------: | :-------: |
|
|
490
|
-
| `importConstruction` | - | `files: File[]`
|
|
491
|
-
| `importGgb` | - | `file: File`
|
|
492
|
-
| `exportGgb` | - | -
|
|
493
|
-
| `exportPng` | - | -
|
|
494
|
-
| `exportSvg` | - | -
|
|
495
|
-
| `focus` | - | `options: FocusOptions`
|
|
496
|
-
|
|
497
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
498
|
-
|
|
499
|
-
## Events
|
|
500
|
-
| Name | Description |
|
|
501
|
-
| :--: | :---------: |
|
|
502
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
503
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
504
|
-
|
|
505
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
506
|
-
|
|
507
|
-
## CSS parts
|
|
508
|
-
| Name | Description |
|
|
509
|
-
| :--: | :---------: |
|
|
510
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
511
|
-
|
|
512
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
513
|
-
|
|
514
|
-
## Editing config
|
|
515
|
-
| Name | Value |
|
|
516
|
-
| :--: | :---------: |
|
|
517
|
-
| `content` | `text*` |
|
|
518
|
-
| `importFormats` | `.ggb` |
|
|
519
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
520
|
-
|
|
521
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
522
|
-
|
|
523
|
-
*No public slots, or custom CSS properties.*
|
|
173
|
+
</details>
|
|
524
174
|
|
|
175
|
+
**Events:**
|
|
176
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
177
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
525
178
|
|
|
526
|
-
|
|
527
|
-
|
|
179
|
+
**CSS parts:**
|
|
180
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
528
181
|
|
|
529
|
-
|
|
182
|
+
**CSS properties:**
|
|
183
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
184
|
+
- `--ww-font-family`: Font of the widget.
|
|
185
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
530
186
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
187
|
+
**Methods:**
|
|
188
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
189
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
190
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
191
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
192
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
193
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
537
194
|
|
|
538
|
-
|
|
195
|
+
**Editing config:** `label: Geogebra-3d` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
539
196
|
|
|
540
|
-
|
|
541
|
-
npm install @webwriter/geogebra
|
|
542
|
-
```
|
|
197
|
+
## `WebwriterGeogebraNotes` (`<webwriter-geogebra-notes>`)
|
|
543
198
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
199
|
+
GeoGebra Notes (type "notes"): a whiteboard with pen, shapes, text and math input; use it for sketches, handwritten solutions and free notes. Load a saved board with `src` or leave it out for an empty board.
|
|
200
|
+
|
|
201
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
202
|
+
|
|
203
|
+
**Data block:** The edited or imported construction.
|
|
204
|
+
|
|
205
|
+
<details>
|
|
206
|
+
<summary>JSON Schema</summary>
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
211
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
212
|
+
"title": "GeoGebra construction",
|
|
213
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
214
|
+
"type": "object",
|
|
215
|
+
"properties": {
|
|
216
|
+
"src": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"pattern": "^data:[^,]*;base64,",
|
|
219
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
548
223
|
```
|
|
549
224
|
|
|
550
|
-
|
|
551
|
-
| Name (Attribute Name) | Type | Description | Default | Reflects |
|
|
552
|
-
| :-------------------: | :--: | :---------: | :-----: | :------: |
|
|
553
|
-
| `type` (`type`) | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | app name, default: "classic". "graphing" … GeoGebra Graphing Calculator "geometry" … GeoGebra Geometry "3d" … GeoGebra 3D Graphing Calculator "classic" … GeoGebra Classic "suite" … GeoGebra Calculator Suite "evaluator" … Equation Editor "scientific" …Scientific Calculator "notes" … GeoGebra Notes | `"scientific"` | ✓ |
|
|
554
|
-
| `showZoomButtons` (`showZoomButtons`) | `boolean` | States whether the zoom in / zoom out / home buttons should be shown in the Graphics View or not. Default: false | `true` | ✓ |
|
|
555
|
-
| `showFullscreenButton` (`showFullscreenButton`) | `boolean` | Whether fullscreen button should be visible | `true` | ✓ |
|
|
556
|
-
| `WebwriterGeogebraScientific.options` | - | - | `geogebraOptions` | ✗ |
|
|
557
|
-
| `WebwriterGeogebraScientific.actions` | `object` | - | `{ importConstruction: { label: (widget: {msg: MsgFn}) => ({_: widget.msg("Import construction")}), input: {type: "file" as const, accept: ".ggb", multiple: false}, }, }` | ✗ |
|
|
558
|
-
| `WebwriterGeogebraScientific.convertFrom` | `object` | - | `{".ggb": "importGgb"}` | ✗ |
|
|
559
|
-
| `WebwriterGeogebraScientific.convertTo` | `object` | - | `{".ggb": "exportGgb", "image/png": "exportPng", "image/svg+xml": "exportSvg"}` | ✗ |
|
|
560
|
-
| `msg` | `MsgFn` | - | - | ✗ |
|
|
561
|
-
| `ggbStyles` (`ggbStyles`) | `string` | Custom CSS styles to apply to the GeoGebra applet. | - | ✗ |
|
|
562
|
-
| `width` (`width`) | `number` | Applet width | `800` | ✓ |
|
|
563
|
-
| `height` (`height`) | `number` | Applet height | `450` | ✓ |
|
|
564
|
-
| `src` (`src`) | `string \| undefined` | Source of the GeoGebra file to load (base64-encoded string, material ID prefixed with "ggbid:", or file URL) | - | ✓ |
|
|
565
|
-
| `borderColor` (`borderColor`) | `string` | Color of the border line drawn around the applet panel (as hex rgb string). Default: gray | `"gray"` | ✓ |
|
|
566
|
-
| `borderRadius` (`borderRadius`) | `number` | Size of applet's border radius in pixels. | `1` | ✓ |
|
|
567
|
-
| `enableRightClick` (`enableRightClick`) | `boolean` | States whether right clicks should be handled by the applet. Setting this parameter to "false" disables context menus, properties dialogs and right-click-zooming. Default: true. NB also enables/disables some keyboard shortcuts eg Delete and Ctrl + R (recompute all objects). Default: true | `true` | ✓ |
|
|
568
|
-
| `enableLabelDrags` (`enableLabelDrags`) | `boolean` | States whether labels can be dragged. Default: true | `true` | ✓ |
|
|
569
|
-
| `enableShiftDragZoom` (`enableShiftDragZoom`) | `boolean` | States whether the Graphics View(s) should be moveable using Shift mouse drag (or. Ctrl + mouse drag) or zoomable using Shift + mouse wheel (or Ctrl + mouse wheel). Setting this parameter to "false" disables moving and zooming of the drawing pad. Default: true | `true` | ✓ |
|
|
570
|
-
| `errorDialogsActive` (`errorDialogsActive`) | `boolean` | States whether error dialogs will be shown if an invalid input is entered (using the Input Bar or JavaScript) Default: true | `true` | ✓ |
|
|
571
|
-
| `showMenuBar` (`showMenuBar`) | `boolean` | States whether the menubar of GeoGebra should be shown in the applet. Default: false | `false` | ✓ |
|
|
572
|
-
| `showToolBar` (`showToolBar`) | `boolean` | States whether the toolbar with the construction mode buttons should be shown in the applet. Default: false | `true` | ✓ |
|
|
573
|
-
| `showToolBarHelp` (`showToolBarHelp`) | `boolean` | States whether the toolbar help text right to the toolbar buttons should be shown in the applet | `false` | ✓ |
|
|
574
|
-
| `customToolBar` (`customToolBar`) | `string \| undefined` | Sets the toolbar according to a custom toolbar string where the int values are Toolbar Mode Values, `,` adds a separator within a menu, `\|` starts a new menu and `\|\|` adds a separator in the toolbar before starting a new menu. This will override the saved toolbar from the .ggb file / base64 string. Custom tools are numbered 100 001, 100 002, etc | - | ✓ |
|
|
575
|
-
| `showAlgebraInput` (`showAlgebraInput`) | `boolean` | States whether the algebra input line (with input field, greek letters and command list) should be shown in the applet. Default: false | `true` | ✓ |
|
|
576
|
-
| `showResetIcon` (`showResetIcon`) | `boolean` | States whether a small icon (GeoGebra ellipse) should be shown in the upper right corner of the applet. Clicking on this icon resets the applet (i.e. it reloads the file given in the filename parameter). Default: false | `false` | ✓ |
|
|
577
|
-
| `language` (`language`) | `string \| undefined` | ISO language string. GeoGebra tries to set your local language automatically (if it is available among the supported languages, of course). The default language for unsupported languages is English. If you want to specify a certain language manually, please use this parameter. | - | ✓ |
|
|
578
|
-
| `country` (`country`) | `string \| undefined` | ISO country string. This parameter only makes sense if you use it together with the language parameter. | - | ✓ |
|
|
579
|
-
| `appletId` (`appletId`) | `string \| undefined` | This parameter allows you to specify the argument passed to the JavaScript function ggbOnInit(), which is called once the applet is fully initialised. This is useful when you have multiple applets on a page. | - | ✓ |
|
|
580
|
-
| `allowStyleBar` (`allowStyleBar`) | `boolean` | Determines whether the Style Bar can be shown (or will be shown if just Graphics View 1 is showing). Default: false | `false` | ✓ |
|
|
581
|
-
| `randomize` (`randomize`) | `boolean` | Determines whether random numbers should be randomized on file load. Useful when you want the app to reload in exactly the same state it was saved. Default: true | `true` | ✓ |
|
|
582
|
-
| `randomSeed` (`randomSeed`) | `number \| undefined` | Specify seed for random numbers. Note that if you save a state of the app after user interacted with it and try to reload that state with the same randomSeed, you may get a different result. Use randomize for those use-cases. | - | ✓ |
|
|
583
|
-
| `useBrowserForJs` (`useBrowserForJs`) | `boolean` | When true, GeoGebra: runs ggbOnInit from HTML, ignores ggbOnInit from file, and ignores JS update scripts of objects in file. When false, GeoGebra: ignores ggbOnInit from HTML (use appletOnLoad parameter of GGBApplet instead), runs ggbOnInit from file, and runs JS update scripts of objects in file. Default: false | `false` | ✓ |
|
|
584
|
-
| `showLogging` (`showLogging`) | `boolean` | Determines whether logging is shown in the Browser's console. Default: false | `false` | ✓ |
|
|
585
|
-
| `capturingThreshold` (`capturingThreshold`) | `number` | Determines the sensitivity of object selection. The default value of 3 is usually fine to select and drag objects both with the mouse and touch. Use larger values (e.g. 4 or 5) to make it easier to select and drag objects. Default: 3 | `3` | ✓ |
|
|
586
|
-
| `enableFileFeatures` (`enableFileFeatures`) | `boolean` | Determines whether file saving, file loading, sign in and Options > Save settings are enabled. This argument is ignored when menubar is not showing. Default: true | `true` | ✓ |
|
|
587
|
-
| `enableUndoRedo` (`enableUndoRedo`) | `boolean` | Determines whether Undo and Redo icons are shown. This argument is ignored when toolbar is not showing. Default: true | `true` | ✓ |
|
|
588
|
-
| `perspective` (`perspective`) | `string \| undefined` | For values see SetPerspective_Command in the GeoGebra Manual. Just for a blank start ie shouldn't be used with material_id, filename or ggbBase64 parameters | - | ✓ |
|
|
589
|
-
| `enable3d` (`enable3d`) | `boolean \| undefined` | Whether 3D should be enabled (for exam mode). | - | ✓ |
|
|
590
|
-
| `enableCAS` (`enableCAS`) | `boolean \| undefined` | Whether CAS should be enabled (for exam mode). | - | ✓ |
|
|
591
|
-
| `algebraInputPosition` (`algebraInputPosition`) | `"algebra" \| "top" \| "bottom" \| undefined` | Determines whether input bar should be shown in algebra, on top of the applet or under the applet. When left empty (default), the position depends on file. | - | ✓ |
|
|
592
|
-
| `preventFocus` (`preventFocus`) | `boolean` | When set to true, this prevents the applet from getting focus automatically at the start. Default: false | `false` | ✓ |
|
|
593
|
-
| `scaleContainerClass` (`scaleContainerClass`) | `string \| undefined` | Name of CSS class that is used as container; applet will scale to fit into the container. | - | ✓ |
|
|
594
|
-
| `autoHeight` (`autoHeight`) | `boolean` | `true` to restrict the width of the applet and compute height automatically, add autoHeight: true. `false` if you want the applet to be restricted by both width and height of the container | `true` | ✓ |
|
|
595
|
-
| `allowUpscale` (`allowUpscale`) | `boolean` | Determines whether automatic scaling may scale the applet up. Default: false | `false` | ✓ |
|
|
596
|
-
| `playButton` (`playButton`) | `boolean` | Determines whether a preview image and a play button should be rendered in place of the applet. Pushing the play button initializes the applet. Default: false | `false` | ✓ |
|
|
597
|
-
| `scale` (`scale`) | `number` | Ratio by which the applet should be scaled (eg. 2 makes the applet 2 times bigger, including all texts and UI elements). Default: 1 | `1` | ✓ |
|
|
598
|
-
| `showAnimationButton` (`showAnimationButton`) | `boolean` | Whether animation button should be visible | `false` | ✓ |
|
|
599
|
-
| `showSuggestionButtons` (`showSuggestionButtons`) | `boolean` | Whether suggestion buttons (special points, solve) in Algebra View should be visible | `false` | ✓ |
|
|
600
|
-
| `showStartTooltip` (`showStartTooltip`) | `boolean` | Whether "Welcome" tooltip should be shown | `false` | ✓ |
|
|
601
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
602
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
603
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
604
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
605
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
606
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
607
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
608
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
609
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
610
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
611
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
612
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
613
|
-
|
|
614
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
615
|
-
|
|
616
|
-
## Methods
|
|
617
|
-
| Name | Description | Parameters |
|
|
618
|
-
| :--: | :---------: | :-------: |
|
|
619
|
-
| `importConstruction` | - | `files: File[]`
|
|
620
|
-
| `importGgb` | - | `file: File`
|
|
621
|
-
| `exportGgb` | - | -
|
|
622
|
-
| `exportPng` | - | -
|
|
623
|
-
| `exportSvg` | - | -
|
|
624
|
-
| `focus` | - | `options: FocusOptions`
|
|
625
|
-
|
|
626
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
627
|
-
|
|
628
|
-
## Events
|
|
629
|
-
| Name | Description |
|
|
630
|
-
| :--: | :---------: |
|
|
631
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
632
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
633
|
-
|
|
634
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
635
|
-
|
|
636
|
-
## CSS parts
|
|
637
|
-
| Name | Description |
|
|
638
|
-
| :--: | :---------: |
|
|
639
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
640
|
-
|
|
641
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
642
|
-
|
|
643
|
-
## Editing config
|
|
644
|
-
| Name | Value |
|
|
645
|
-
| :--: | :---------: |
|
|
646
|
-
| `content` | `text*` |
|
|
647
|
-
| `importFormats` | `.ggb` |
|
|
648
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
649
|
-
|
|
650
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
651
|
-
|
|
652
|
-
*No public slots, or custom CSS properties.*
|
|
225
|
+
</details>
|
|
653
226
|
|
|
227
|
+
**Events:**
|
|
228
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
229
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
654
230
|
|
|
655
|
-
|
|
656
|
-
|
|
231
|
+
**CSS parts:**
|
|
232
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
657
233
|
|
|
658
|
-
|
|
234
|
+
**CSS properties:**
|
|
235
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
236
|
+
- `--ww-font-family`: Font of the widget.
|
|
237
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
659
238
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
239
|
+
**Methods:**
|
|
240
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
241
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
242
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
243
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
244
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
245
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
666
246
|
|
|
667
|
-
|
|
247
|
+
**Editing config:** `label: Geogebra Notes` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
668
248
|
|
|
669
|
-
|
|
670
|
-
npm install @webwriter/geogebra
|
|
671
|
-
```
|
|
249
|
+
## `WebwriterGeogebraScientific` (`<webwriter-geogebra-scientific>`)
|
|
672
250
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
251
|
+
GeoGebra Scientific Calculator (type "scientific"): a calculator for fractions, powers, roots, trigonometry and logarithms; use it when learners need a calculator but no graphs or constructions. It is normally used without `src`.
|
|
252
|
+
|
|
253
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
254
|
+
|
|
255
|
+
**Data block:** The edited or imported construction.
|
|
256
|
+
|
|
257
|
+
<details>
|
|
258
|
+
<summary>JSON Schema</summary>
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
263
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
264
|
+
"title": "GeoGebra construction",
|
|
265
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
266
|
+
"type": "object",
|
|
267
|
+
"properties": {
|
|
268
|
+
"src": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"pattern": "^data:[^,]*;base64,",
|
|
271
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
677
275
|
```
|
|
678
276
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
| `rounding` (`rounding`) | `string \| undefined` | String composed of number of decimal places and flags — valid flags are "s" for significant digits and "r" for rational numbers. Hence "10" means 10 decimal places, "10s" stands for 10 significant digits. | - | ✓ |
|
|
731
|
-
| `buttonShadows` (`buttonShadows`) | `boolean` | Whether buttons should have shadow | `false` | ✓ |
|
|
732
|
-
| `buttonRounding` (`buttonRounding`) | `number` | Relative radius of button's rounded border. The border radius in pixels is buttonRounding * height /2, where height is the height of the button. Default: 0.2 | `0.2` | ✓ |
|
|
733
|
-
| `buttonBorderColor` (`buttonBorderColor`) | `string \| undefined` | Border color of buttons on the graphics view. Default is black, if the button background is white, otherwise one shade darker than the background color | - | ✓ |
|
|
734
|
-
| `editorBackgroundColor` (`editorBackgroundColor`) | `string \| undefined` | Background color of the evaluator app | - | ✓ |
|
|
735
|
-
| `editorForegroundColor` (`editorForegroundColor`) | `string \| undefined` | Foreground (text) color of the equation editor (appname = "evaluator") | - | ✓ |
|
|
736
|
-
| `textmode` (`textmode`) | `boolean` | Whether editor is in text mode or not (appname = "evaluator"). Default: false | `false` | ✓ |
|
|
737
|
-
| `showKeyboardOnFocus` (`showKeyboardOnFocus`) | `boolean \| undefined` | Whether to show keyboard when input is focused. When set to true, keyboard is always shown, for false it never appears, for auto it's shown unless closed by user. Default: true in evaluator app, auto in other apps | - | ✓ |
|
|
738
|
-
| `keyboardType` (`keyboardType`) | `"scientific" \| "normal" \| "notes" \| undefined` | Which keyboard is shown for equation editor (appname = "evaluator") | - | ✓ |
|
|
739
|
-
| `transparentGraphics` (`transparentGraphics`) | `boolean` | Whether the Graphics View and Graphics View 2 should be transparent | `false` | ✓ |
|
|
740
|
-
| `disabledJavaScript` (`disabledJavaScript`) | `boolean` | Whether running JavaScript from material files is disabled or not. | `false` | ✓ |
|
|
741
|
-
| `detachedKeyboardParent` (`detachedKeyboardParent`) | `string \| undefined` | When set, the keyboard should be attached to the first element in DOM that fits the selector. | - | ✓ |
|
|
742
|
-
|
|
743
|
-
*Fields including [properties](https://developer.mozilla.org/en-US/docs/Glossary/Property/JavaScript) and [attributes](https://developer.mozilla.org/en-US/docs/Glossary/Attribute) define the current state of the widget and offer customization options.*
|
|
744
|
-
|
|
745
|
-
## Methods
|
|
746
|
-
| Name | Description | Parameters |
|
|
747
|
-
| :--: | :---------: | :-------: |
|
|
748
|
-
| `importConstruction` | - | `files: File[]`
|
|
749
|
-
| `importGgb` | - | `file: File`
|
|
750
|
-
| `exportGgb` | - | -
|
|
751
|
-
| `exportPng` | - | -
|
|
752
|
-
| `exportSvg` | - | -
|
|
753
|
-
| `focus` | - | `options: FocusOptions`
|
|
754
|
-
|
|
755
|
-
*[Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) allow programmatic access to the widget.*
|
|
756
|
-
|
|
757
|
-
## Events
|
|
758
|
-
| Name | Description |
|
|
759
|
-
| :--: | :---------: |
|
|
760
|
-
| focus | Fired when the GeoGebra applet gains focus. |
|
|
761
|
-
| ggb-load | Fired when the GeoGebra API is ready. The event detail contains the API instance. |
|
|
762
|
-
|
|
763
|
-
*[Events](https://developer.mozilla.org/en-US/docs/Web/Events) are dispatched by the widget after certain triggers.*
|
|
764
|
-
|
|
765
|
-
## CSS parts
|
|
766
|
-
| Name | Description |
|
|
767
|
-
| :--: | :---------: |
|
|
768
|
-
| applet | The iframe that holds the GeoGebra applet. |
|
|
769
|
-
|
|
770
|
-
*[CSS parts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_shadow_parts) allow freely styling internals of the widget with CSS.*
|
|
771
|
-
|
|
772
|
-
## Editing config
|
|
773
|
-
| Name | Value |
|
|
774
|
-
| :--: | :---------: |
|
|
775
|
-
| `content` | `text*` |
|
|
776
|
-
| `importFormats` | `.ggb` |
|
|
777
|
-
| `exportFormats` | `.ggb,image/png,image/svg+xml` |
|
|
778
|
-
|
|
779
|
-
*The [editing config](https://webwriter.app/docs/packages/configuring/#editingconfig) defines how explorable authoring tools such as [WebWriter](https://webwriter.app) treat the widget.*
|
|
780
|
-
|
|
781
|
-
*No public slots, or custom CSS properties.*
|
|
277
|
+
</details>
|
|
278
|
+
|
|
279
|
+
**Events:**
|
|
280
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
281
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
282
|
+
|
|
283
|
+
**CSS parts:**
|
|
284
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
285
|
+
|
|
286
|
+
**CSS properties:**
|
|
287
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
288
|
+
- `--ww-font-family`: Font of the widget.
|
|
289
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
290
|
+
|
|
291
|
+
**Methods:**
|
|
292
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
293
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
294
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
295
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
296
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
297
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
298
|
+
|
|
299
|
+
**Editing config:** `label: Geogebra Scientific` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
300
|
+
|
|
301
|
+
## `WebwriterGeogebraClassic` (`<webwriter-geogebra-classic>`)
|
|
302
|
+
|
|
303
|
+
GeoGebra Classic (type "classic"): the full app with algebra, graphics, spreadsheet and CAS views; use it to pick the views of a blank app (`perspective`), for graphs with an algebra view, or for a material whose app you do not know. Load a construction with `src` or leave it out for a blank app.
|
|
304
|
+
|
|
305
|
+
**Shared attributes:** `ggbstyles`, `type`, `width`, `height`, `src`, `bordercolor`, `borderradius`, `enablerightclick`, `enablelabeldrags`, `enableshiftdragzoom`, `showzoombuttons`, `errordialogsactive`, `showmenubar`, `showtoolbar`, `showtoolbarhelp`, `customtoolbar`, `showalgebrainput`, `showreseticon`, `language`, `country`, `appletid`, `allowstylebar`, `randomize`, `randomseed`, `usebrowserforjs`, `showlogging`, `capturingthreshold`, `enablefilefeatures`, `enableundoredo`, `perspective`, `enable3d`, `enablecas`, `algebrainputposition`, `preventfocus`, `scalecontainerclass`, `autoheight`, `allowupscale`, `playbutton`, `scale`, `showanimationbutton`, `showfullscreenbutton`, `showsuggestionbuttons`, `showstarttooltip`, `rounding`, `buttonshadows`, `buttonrounding`, `buttonbordercolor`, `editorbackgroundcolor`, `editorforegroundcolor`, `textmode`, `showkeyboardonfocus`, `keyboardtype`, `transparentgraphics`, `disabledjavascript`, `detachedkeyboardparent` (see Shared attributes).
|
|
306
|
+
|
|
307
|
+
**Data block:** The edited or imported construction.
|
|
308
|
+
|
|
309
|
+
<details>
|
|
310
|
+
<summary>JSON Schema</summary>
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
315
|
+
"$id": "https://cdn.jsdelivr.net/npm/@webwriter/geogebra@2/schemas/construction.schema.json",
|
|
316
|
+
"title": "GeoGebra construction",
|
|
317
|
+
"description": "The construction as edited in the applet or imported; the widget writes it, never write it by hand. It wins over the src attribute, which the widget then removes.",
|
|
318
|
+
"type": "object",
|
|
319
|
+
"properties": {
|
|
320
|
+
"src": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"pattern": "^data:[^,]*;base64,",
|
|
323
|
+
"description": "The .ggb file (a zip archive) as a base64 data URL: \"data:application/vnd.geogebra.file;base64,…\". A value that does not start with \"data:\" is ignored."
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
782
328
|
|
|
329
|
+
</details>
|
|
330
|
+
|
|
331
|
+
**Events:**
|
|
332
|
+
- `focus`: Fired when the GeoGebra applet gains focus.
|
|
333
|
+
- `ggb-load`: Fired when the GeoGebra applet has loaded; `detail.api` is the applet's GeoGebra API (evalCommand, getBase64, …).
|
|
334
|
+
|
|
335
|
+
**CSS parts:**
|
|
336
|
+
- `applet`: The iframe that holds the GeoGebra applet.
|
|
337
|
+
|
|
338
|
+
**CSS properties:**
|
|
339
|
+
- `--ww-text-color`: Text color of the widget (the note shown when printing without a loaded applet).
|
|
340
|
+
- `--ww-font-family`: Font of the widget.
|
|
341
|
+
- `--ww-link-color`: Color of the focus ring around the applet.
|
|
342
|
+
|
|
343
|
+
**Methods:**
|
|
344
|
+
- `importConstruction(files)`: Replaces the construction with the first of the given .ggb files (the "Import construction" action).
|
|
345
|
+
- `importGgb(file)`: Reads a .ggb file and returns a function that replaces the construction with it; throws for a file that is no zip archive.
|
|
346
|
+
- `exportGgb()`: The current construction as a .ggb file, or null when there is none.
|
|
347
|
+
- `exportPng()`: A PNG picture of the graphics view, or null while the applet is not loaded.
|
|
348
|
+
- `exportSvg()`: An SVG picture of the graphics view, or null while the applet is not loaded or after 8 seconds without an answer.
|
|
349
|
+
- `focus(options)`: Focuses the applet's iframe.
|
|
350
|
+
|
|
351
|
+
**Editing config:** `label: Geogebra Classic` · `importFormats: .ggb` · `exportFormats: .ggb, image/png, image/svg+xml` · `content: text*`
|
|
352
|
+
|
|
353
|
+
## Shared attributes
|
|
354
|
+
Shared by `<webwriter-geogebra>`, `<webwriter-geogebra-geometry>`, `<webwriter-geogebra-3d>`, `<webwriter-geogebra-notes>`, `<webwriter-geogebra-scientific>`, `<webwriter-geogebra-classic>`:
|
|
355
|
+
|
|
356
|
+
| Name (Attribute Name) | Type | Description | Default |
|
|
357
|
+
| :-- | :-- | :-- | :-- |
|
|
358
|
+
| `ggbstyles` | `string` | Advanced: CSS text injected into the applet's iframe. It replaces the default rules, which align the app header (and on `<webwriter-geogebra>` also hide undo/redo). Usually leave unset. | - |
|
|
359
|
+
| `type` | `"classic" \| "geometry" \| "3d" \| "suite" \| "evaluator" \| "scientific" \| "notes"` | The GeoGebra app. Each tag sets its own (see its description; the listed default is the classic tag's). Set it only to switch apps, e.g. to "evaluator": the equation editor, a math input field. | `"classic"` |
|
|
360
|
+
| `width` | `number` | Initial applet width in pixels. The widget then fits the applet to its container (300 to 2100 px wide, 16:9), so this does not set the displayed size. | `800` |
|
|
361
|
+
| `height` | `number` | Initial applet height in pixels. Like `width`, it does not set the displayed size (16:9, at least 18rem high). | `450` |
|
|
362
|
+
| `src` | `string \| undefined` | Construction to load: "ggbid:<id>" for the material at geogebra.org/m/<id>, or the URL of a .ggb file. Leave out for a blank app. Edits and imports go to the data block instead. | - |
|
|
363
|
+
| `bordercolor` | `string` | Color of the border line around the applet, e.g. "#cccccc". | `"gray"` |
|
|
364
|
+
| `borderradius` | `number` | Corner radius of the applet border in pixels. | `1` |
|
|
365
|
+
| `enablerightclick` | `"true" \| "false"` | Whether right-click opens context menus and object properties; "false" also turns off some shortcuts such as Delete. | `true` |
|
|
366
|
+
| `enablelabeldrags` | `"true" \| "false"` | Whether learners can drag object labels. | `true` |
|
|
367
|
+
| `enableshiftdragzoom` | `"true" \| "false"` | Whether learners can pan (Shift or Ctrl + drag) and zoom (Shift or Ctrl + wheel) the graphics view; "false" turns off moving and zooming the view altogether, so the visible area stays fixed. Hide the zoom buttons too, with `showzoombuttons="false"`. | `true` |
|
|
368
|
+
| `showzoombuttons` | `"true" \| "false"` | Whether zoom in, zoom out and home buttons appear in the graphics view. | `true` |
|
|
369
|
+
| `errordialogsactive` | `"true" \| "false"` | Whether invalid input shows an error dialog. | `true` |
|
|
370
|
+
| `showmenubar` | `"true" \| "false"` | Whether GeoGebra's menu bar is shown. | `false` |
|
|
371
|
+
| `showtoolbar` | `"true" \| "false"` | Whether the toolbar with the construction tools is shown; `customtoolbar` chooses its tools. | `true` |
|
|
372
|
+
| `showtoolbarhelp` | `"true" \| "false"` | Whether a help text for the selected tool appears next to the toolbar. | `false` |
|
|
373
|
+
| `customtoolbar` | `string \| undefined` | Tools in the toolbar: GeoGebra tool numbers, spaces between tools of one menu, "\|" before the next menu, "," a separator in a menu. "0 \| 1 \| 15 \| 10" gives Move, Point, Segment, Circle. Overrides the file's toolbar. | - |
|
|
374
|
+
| `showalgebrainput` | `"true" \| "false"` | Whether the input line is shown, where learners type objects and commands such as f(x) = x^2 or Circle(A, 3). | `true` |
|
|
375
|
+
| `showreseticon` | `"true" \| "false"` | Whether an icon in the upper right corner resets the applet to the construction it loaded with. | `false` |
|
|
376
|
+
| `language` | `string \| undefined` | Applet language as an ISO 639-1 code such as "de". Usually leave out: the applet follows the nearest lang attribute, i.e. the document language. | - |
|
|
377
|
+
| `country` | `string \| undefined` | ISO 3166 country code such as "AT" for a regional variant of the language. Left out, it is the region of the document language (none when `language` is set). | - |
|
|
378
|
+
| `appletid` | `string \| undefined` | Id passed to GeoGebra as the applet id (the argument of ggbOnInit). Usually leave out. | - |
|
|
379
|
+
| `allowstylebar` | `"true" \| "false"` | Whether the style bar (color, line style and label of the selected object) can be shown. | `false` |
|
|
380
|
+
| `randomize` | `"true" \| "false"` | Whether random numbers in the construction are drawn anew on each load; "false" keeps the saved values. | `true` |
|
|
381
|
+
| `randomseed` | `number \| undefined` | Integer seed for random numbers, so that every load draws the same values. | - |
|
|
382
|
+
| `usebrowserforjs` | `"true" \| "false"` | Advanced: "true" ignores the scripts saved in the construction (ggbOnInit and object update scripts); "false" runs them. | `false` |
|
|
383
|
+
| `showlogging` | `"true" \| "false"` | Whether GeoGebra writes log messages to the browser console. | `false` |
|
|
384
|
+
| `capturingthreshold` | `number` | How easily pointer and touch select and drag objects; larger values (4 or 5) make it easier. | `3` |
|
|
385
|
+
| `enablefilefeatures` | `"true" \| "false"` | Whether the menu offers saving, opening, sign-in and saving settings; matters only with `showmenubar`. `<webwriter-geogebra>` defaults to "false". | `true` |
|
|
386
|
+
| `enableundoredo` | `"true" \| "false"` | No effect yet: the widget does not pass it to GeoGebra. Undo and redo show with the toolbar, except on `<webwriter-geogebra>`, whose `ggbstyles` hide them. | `true` |
|
|
387
|
+
| `perspective` | `string \| undefined` | Views of a blank app (without `src`), as GeoGebra perspective letters: A algebra, G graphics, D graphics 2, T 3D graphics, S spreadsheet, C CAS, B probability, L construction protocol; e.g. "AG". | - |
|
|
388
|
+
| `enable3d` | `"true" \| "false"` | Whether 3D graphics are available; "false" removes them, e.g. for a test. Left out, the app decides. | - |
|
|
389
|
+
| `enablecas` | `"true" \| "false"` | Whether the CAS (symbolic algebra: Solve, Factor, …) is available; "false" turns it off, e.g. for a test. Left out, the app decides. | - |
|
|
390
|
+
| `algebrainputposition` | `"algebra" \| "top" \| "bottom" \| undefined` | Where the input line appears: "algebra" inside the algebra view, "top" or "bottom" of the applet. Left out, the construction decides. | - |
|
|
391
|
+
| `preventfocus` | `"true" \| "false"` | Whether the applet must not take the focus when it starts. | `false` |
|
|
392
|
+
| `scalecontainerclass` | `string \| undefined` | GeoGebra's scaling container (a CSS class). Leave out: the widget already fits the applet to its container. | - |
|
|
393
|
+
| `autoheight` | `"true" \| "false"` | Only with `scalecontainerclass`: whether GeoGebra computes the height from the width. | `true` |
|
|
394
|
+
| `allowupscale` | `"true" \| "false"` | Only with `scalecontainerclass`: whether GeoGebra may scale the applet up. | `false` |
|
|
395
|
+
| `playbutton` | `"true" \| "false"` | Whether a preview image with a play button stands in for the applet until a learner clicks it. | `false` |
|
|
396
|
+
| `scale` | `number` | Scale factor of the whole applet, texts and buttons included; 2 doubles it. | `1` |
|
|
397
|
+
| `showanimationbutton` | `"true" \| "false"` | Whether a play/pause button for animations (e.g. animated sliders) is shown in the graphics view. | `false` |
|
|
398
|
+
| `showfullscreenbutton` | `"true" \| "false"` | Whether a fullscreen button is shown. | `true` |
|
|
399
|
+
| `showsuggestionbuttons` | `"true" \| "false"` | Whether suggestion buttons (special points, solve) appear in the algebra view. | `false` |
|
|
400
|
+
| `showstarttooltip` | `"true" \| "false"` | Whether GeoGebra's welcome tooltip appears at the start. | `false` |
|
|
401
|
+
| `rounding` | `string \| undefined` | Displayed precision: decimal places, or significant digits with "s" ("2" rounds to 2 decimal places, "4s" to 4 significant digits). Left out, the construction decides. | - |
|
|
402
|
+
| `buttonshadows` | `"true" \| "false"` | Whether buttons in the graphics view have shadows. | `false` |
|
|
403
|
+
| `buttonrounding` | `number` | Corner radius of buttons in the graphics view, relative to half their height (radius = value × height / 2). | `0.2` |
|
|
404
|
+
| `buttonbordercolor` | `string \| undefined` | Border color of buttons in the graphics view, e.g. "#000000". Left out: black on white buttons, otherwise a shade darker than the button. | - |
|
|
405
|
+
| `editorbackgroundcolor` | `string \| undefined` | Background color of the equation editor (type "evaluator" only), e.g. "#ffffff". | - |
|
|
406
|
+
| `editorforegroundcolor` | `string \| undefined` | Text color of the equation editor (type "evaluator" only), e.g. "#000000". | - |
|
|
407
|
+
| `textmode` | `"true" \| "false"` | Whether the equation editor (type "evaluator") starts in text mode. | `false` |
|
|
408
|
+
| `showkeyboardonfocus` | `"true" \| "false"` | Whether the on-screen keyboard opens when an input is focused: "true" always, "false" never. Left out: always in the equation editor, otherwise until the learner closes it. | - |
|
|
409
|
+
| `keyboardtype` | `"scientific" \| "normal" \| "notes" \| undefined` | On-screen keyboard of the equation editor (type "evaluator"): "scientific", "normal" or "notes". | - |
|
|
410
|
+
| `transparentgraphics` | `"true" \| "false"` | Whether the graphics views have a transparent background. | `false` |
|
|
411
|
+
| `disabledjavascript` | `"true" \| "false"` | Whether JavaScript saved in the construction is blocked. | `false` |
|
|
412
|
+
| `detachedkeyboardparent` | `string \| undefined` | CSS selector of an element to hold the on-screen keyboard. Leave out: the applet runs in the widget's own iframe. | - |
|
|
413
|
+
|
|
414
|
+
*Attributes configure a widget in HTML; properties, methods and events are its JavaScript API. Editing config describes how [WebWriter](https://webwriter.app) treats the widget.*
|
|
415
|
+
<!-- webwriter:reference:end -->
|
|
783
416
|
|
|
784
417
|
---
|
|
785
|
-
*Generated with @webwriter/build@1.
|
|
418
|
+
*Generated with @webwriter/build@1.16.0*
|