DocumentTools/Canvas/NewCanvas - Maple Help

DocumentTools[Canvas]

 NewCanvas
 create a canvas

 Calling Sequence NewCanvas(elements) NewCanvas(elements,script) NewCanvas(caption, options)

Parameters

 elements - list script - (optional) Script object output - (optional) output=records or output=string

Description

 • The NewCanvas command creates a canvas data structure that can be viewed in Maple via ShowCanvas, or in Maple Learn via ShareCanvas.   Script actions can be performed on a canvas to demonstrate activities or provide an interactive experience.
 • The first argument, elements, should be a list of the various components that should be included in the canvas.  Strings in the list are mapped to text components and math to math components, but Math, Text, Group, StaticPlot, and Button objects can also be used for further control and customization.  A sublist can be used to control layout, putting the contents of the sublist in columns.
 • If the script parameter is provided, those actions are merged into the canvas and will automatically be executed when the canvas is opened in Maple Learn
 • The default return value is an XML string that defines the canvas.  Using output=records causes the intermediate record-based data-structures to be returned instead of the canvas string.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Canvas}\right):$
 > $\mathrm{cv}≔\mathrm{NewCanvas}\left(\left["Title",\left["Column 1","Column 2"\right],\left[\mathrm{Text}\left("Mixed %1",\mathrm{sqrt}\left({b}^{2}-4ac\right)\right),\mathrm{Math}\left(\mathrm{\pi }\right)\right],\mathrm{Int}\left(\mathrm{sqrt}\left(\mathrm{sqrt}\left({x}^{n}\right)+\frac{1}{\mathrm{\alpha }+{\mathrm{\beta }}^{\mathrm{\gamma }}}\right),x=-\mathrm{\infty }..\mathrm{\infty }\right),\left[\mathrm{Group}\left(\left["basics",\mathrm{%+}\left(1,1\right),\mathrm{%+}\left(2,2\right)\right]\right)\right]\right]\right):$
 > $\mathrm{ShowCanvas}\left(\mathrm{cv}\right)$
 > $\mathrm{ShareCanvas}\left(\mathrm{cv}\right)$

Compatibility

 • The DocumentTools[Canvas][NewCanvas] command was introduced in Maple 2021.