NewCanvas - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


DocumentTools[Canvas]

  

NewCanvas

  

create a canvas

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

NewCanvas(elements)

NewCanvas(elements,script)

NewCanvas(caption, options)

Parameters

elements

-

list

script

-

(optional) Script object

output

-

(optional) output=records or output=string

radians

-

(optional) truefalse; radians or degrees mode

showpanel

-

(optional) truefalse; show or hide the context panel

fontsize

-

(optional) posint; default font size

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

withDocumentTools:-Canvas:

cvNewCanvasTitle,Column 1,Column 2,Math%sinπ,TextMixed %1,sqrtb24ac,Intsqrtsqrtxn+1α+βγ,x=..,Groupbasics,`%+`1,1,`%+`2,2:

ShowCanvascv

ShareCanvascv

This example uses Groups to create the columns and a fixed pixel position to locate the second column avoiding overlap.  Note the use of result=false to turn off the computed result of the integral when viewed in Maple Learn.

cvNewCanvasTextTitle,fontsize=26,bold,GroupColumn 1,TextWide Math %1,sqrtb24ac,MathIntsqrtsqrtxn+1α+βγ,x=..,result=false,GroupColumn 2,Math%sinπ,`%+`1,1`%/``%*`2,2,4,position=400,90:

ShowCanvascv

ShareCanvascv

Compatibility

• 

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

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

• 

The radians, showpanel and fontsize parameters were introduced in Maple 2023.

• 

For more information on Maple 2023 changes, see Updates in Maple 2023.

See Also

Annotate

GetCanvas

Math

Script

ShareCanvas

Text