Overview of the DocumentTools:-Canvas Package
Description
Tutorial - Using the Canvas Package
List of Commands in the Canvas Package
Compatibility
A "canvas" is both (1) a document template where math can be inserted and acted upon by button clicks within Maple, and (2) the document environment used by Maple Learn.
The DocumentTools:-Canvas package builds on DocumentTools component primitives to provide a way to generate such a canvas.
The NewCanvas and ShowCanvas commands can be used to construct and display math and text content organized in a grid layout. When a ScriptButton is present, additional controls and blank entry boxes are available for user input. Using Script actions the math and text can be modified and/or annotated.
In scenario (1), the canvas is viewed and interacted with directly inside a Maple document. In scenario (2), the ShareCanvas command is used to send the canvas to Maple Learn, where it can be viewed and interacted with inside a web browser.
ElementsAndLayout
Canvas Elements and Layout
ButtonIntro
Introducing the Script Button
CanvasScripting
Advanced Overview of Scripting
GenerateCanvas
Use of Canvas Elements in Maple Library Commands
Example,FindPrimes
Inspect and annotate math on a canvas
Example,NormalDistribution
Make Standard Maple Commands Interactive
Example,DirectionFieldPlot
Example,SolveFeedback
Correct Solution Analysis Plus Try-Another
Example,BinomialQuiz
Initialization, Grading, and New Problem Generation
Example,WordProblem
Canvas-based Word Problem with SolveFeedback
Example,CanvasCurveFitting
Canvas-based Click-on-Plot Example with Hidden State
The extensive gallery Maple Learn Scripting Templates provides many more examples.
The following is a list of commands within the Canvas subpackage of DocumentTools:
AppendToCanvas
append to a canvas
GetCanvas
fetch a canvas from Maple Learn
GetElements
extract element from a canvas
GetMath
extract math from a canvas
Group
create a canvas group structure
Image
create an image canvas element
Line
create a canvas line drawing element
Link
create a hyperlink canvas element
Math
create a math structure with metadata
NewCanvas
create a canvas
Plot3D
create a canvas 3-D plot
Script
script canvas operations
ScriptButton
create a canvas button element
ScriptCheckBox
create a canvas checkbox element
ShareCanvas
send a canvas to Maple Learn
ShowCanvas
insert a canvas
Slider
create a slider canvas element
State
create a canvas state placeholder
StaticPlot
create a canvas plot
TestButtonPress
simulate a button press
Text
create a text structure with metadata
The DocumentTools:-Canvas package was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
Download Help Document