 <?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Max</id>
	<title>Analytica Docs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Max"/>
	<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php/Special:Contributions/Max"/>
	<updated>2026-05-20T08:59:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Links_or_URL_in_model_attributes&amp;diff=63530</id>
		<title>Links or URL in model attributes</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Links_or_URL_in_model_attributes&amp;diff=63530"/>
		<updated>2025-12-07T20:45:58Z</updated>

		<summary type="html">&lt;p&gt;Max: /* HTML markup in Text Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Models]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; User Interfaces for End Users &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
A '''''description''''', or other text attribute of a variable or other object, can contain a hyperlink to any web page{{Release|6.0||, or even to an Analytica expression to run when it is clicked}}. This is useful for linking to detailed explanations, data, references, or to related downloadable Analytica models. In [[browse mode]], hyperlinks are underlined in blue. When you click a hyperlink, your computer shows the indicated web page in your default web browser.&lt;br /&gt;
&lt;br /&gt;
To add or edit a hyperlink (in edit mode), type the text that you want the user to see, select it, and press ctrl+k to open a dialog where you can edit the text and the link:&lt;br /&gt;
:[[image:Edit Hyperlink dialog.png]]&lt;br /&gt;
Select either &amp;lt;code&amp;gt;http://&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;https://&amp;lt;/code&amp;gt;, enter the target URL and press OK. The text displays as a hyperlink. When you switch to browse mode, the HTML code displays as a hyperlink.&lt;br /&gt;
&lt;br /&gt;
Or you can enter the link with standard HTML syntax of the form &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;http://www.analytica.com/&amp;quot;&amp;gt;Click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}{{Release|5.3||type the text you want the user to see. &lt;br /&gt;
&lt;br /&gt;
'''In edit mode''': &lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter9 21.png]]&lt;br /&gt;
&lt;br /&gt;
'''In browse mode''':}}&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter9 22.png]]&lt;br /&gt;
&lt;br /&gt;
When you click on the link in browse mode, it opens the web page. When you click on the link in edit mode, you are given options to go to the page, change the link or remove the link.&lt;br /&gt;
:[[image:Hyperlink options.png]]&lt;br /&gt;
The '''Change''' option re-opens the ''Edit Hyperlink'' dialog shown above.&lt;br /&gt;
&lt;br /&gt;
You can also view the HTML-like &amp;quot;markup&amp;quot; text in edit mode by right-clicking within the attribute text and selecting '''Toggle show markup'''.&lt;br /&gt;
:[[File:Chapter9 21.png]]&lt;br /&gt;
&lt;br /&gt;
== Eval links ==&lt;br /&gt;
You can create a link that evaluates an Analytica expression when you click on it. To do so, select &amp;quot;eval:&amp;quot; in the dropdown.&lt;br /&gt;
&lt;br /&gt;
:[[image:Hyperlink eval.png]]&lt;br /&gt;
&lt;br /&gt;
Eval opens up numerous creative options, including:&lt;br /&gt;
* Calling [[ShowPdfFile]] to open a PDF file.&lt;br /&gt;
* Calling [[ShowWindow]] to show a particular object view (such as a result table, graph, and edit table, or to an object on a diagram, etc.).&lt;br /&gt;
* Display a [[MsgBox]] with some computed information (as in the example shown).&lt;br /&gt;
&lt;br /&gt;
== HTML markup in Text Attributes ==&lt;br /&gt;
&lt;br /&gt;
You can use appearance-related HTML tags in the Description of a text node and other objects (and other text-based attributes including user-defined attributes.) You use standard HTML syntax, like &amp;lt;code&amp;gt;&amp;amp;lt;html&amp;amp;gt;...&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/code&amp;gt;. [[ACP]] renders these when the text node displays in a diagram You can include CSS styles inside styles attributes. Desktop Analytica renders only a subset of these HTML tags. &lt;br /&gt;
&lt;br /&gt;
As of [[Analytica 7.0]], these HTML tags that have an effect in desktop Analytica (but in text nodes only when they display on a diagram) when the attribute is surrounded by &amp;lt;code&amp;gt;&amp;amp;lt;html&amp;amp;gt;...&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/code&amp;gt; (they can be nested):&lt;br /&gt;
* Hyperlink: &amp;lt;code&amp;gt;&amp;amp;lt;a href=&amp;quot;...&amp;quot;&amp;amp;gt;label&amp;amp;lt;/a&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''Bold''': &amp;lt;code&amp;gt;&amp;amp;lt;b&amp;amp;gt;text&amp;amp;lt;/b&amp;amp;gt;&amp;lt;/code&amp;gt;: bold&lt;br /&gt;
* ''Italic'': &amp;lt;code&amp;gt;&amp;amp;lt;i&amp;amp;gt;text&amp;amp;lt;/i&amp;amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;em&amp;amp;gt;text&amp;amp;lt;/em&amp;amp;gt;&amp;lt;/code&amp;gt; (emphasis)&lt;br /&gt;
* Underline: &amp;lt;code&amp;gt;&amp;amp;lt;u&amp;amp;gt;text&amp;amp;lt;/u&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Strike-out: &amp;lt;code&amp;gt;&amp;amp;lt;s&amp;amp;gt;text&amp;amp;lt;/s&amp;amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;strike&amp;amp;gt;text&amp;amp;lt;/strike&amp;amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;del&amp;amp;gt;text&amp;amp;lt;/del&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* In-line block: &amp;lt;code&amp;gt;&amp;amp;lt;span&amp;amp;gt; ... &amp;amp;lt;/span&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Non-inline block: &amp;lt;code&amp;gt;&amp;amp;lt;div&amp;amp;gt;text&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Paragraph block: &amp;lt;code&amp;gt;&amp;amp;lt;p&amp;amp;gt;text&amp;amp;lt;/p&amp;amp;gt;&amp;lt;/code&amp;gt;: &lt;br /&gt;
* Line break: &amp;lt;code&amp;gt;&amp;amp;lt;br/&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Ordered list: &amp;lt;code&amp;gt;&amp;amp;lt;ol&amp;amp;gt; ... &amp;amp;lt;/ol&amp;amp;gt;&amp;lt;/code&amp;gt; containing items tagged as &amp;lt;code&amp;gt;&amp;amp;lt;li&amp;amp;gt;item&amp;amp;lt;/li&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Unordered list: &amp;lt;code&amp;gt;&amp;amp;lt;ul&amp;amp;gt; ... &amp;amp;lt;/ul&amp;amp;gt;&amp;lt;/code&amp;gt;  containing items tagged as &amp;lt;code&amp;gt;&amp;amp;lt;li&amp;amp;gt;item&amp;amp;lt;/li&amp;amp;gt; &amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you use a non-supported HTML tag, it treats it as in-line blocks (same as &amp;lt;code&amp;gt;&amp;amp;lt;span&amp;amp;gt; ... &amp;amp;lt;/span&amp;amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
You can specify &amp;lt;code&amp;gt;style=&amp;quot;...&amp;quot;&amp;lt;/code&amp;gt; attribute on any tag, such as&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div style=&amp;quot;color:red&amp;quot;&amp;gt;some red text&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
but only a few CSS styles have any affect in desktop Analytica. Recognized tags (as of [[Analytica 6.6]]) are:&lt;br /&gt;
* &amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt;:  Text color&lt;br /&gt;
* &amp;lt;code&amp;gt;background-color&amp;lt;/code&amp;gt;: But with some rendering limitations&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
The Edit Hyperlink dialog (a GUI for editing the hyperlinks) was added in [[Analytica 5.3]]. Prior to that, markup displayed in edit mode, hyperlinks in edit mode. &lt;br /&gt;
&lt;br /&gt;
The ability to evaluate an arbitrary expression when the hyperlink is clicked was added in [[Analytica 6.0]].&lt;br /&gt;
&lt;br /&gt;
The bold and italics tags were added in [[Analytica 6.5]].&lt;br /&gt;
&lt;br /&gt;
The extended tags using &amp;lt;code&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/code&amp;gt; were added in [[Analytica 6.6]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[OpenURL]]&lt;br /&gt;
* [[ReadFromUrl]]&lt;br /&gt;
* [[Read data from URL on internet]]&lt;br /&gt;
* [[Retrieving Content From the Web]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Graphics, frames, and text in a diagram / {{PAGENAME}} / Analytica Free Edition&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Formatted_Text_Literals&amp;diff=63441</id>
		<title>Formatted Text Literals</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Formatted_Text_Literals&amp;diff=63441"/>
		<updated>2025-11-17T19:38:41Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Array abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
''New to [[Analytica 6.0]]''&lt;br /&gt;
&lt;br /&gt;
A [[Formatted Text Literals|formatted text literal]] (''F-string'' for short) is a concise way to define text containing expressions, such as the values of variables.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
A [[Formatted Text Literals|formatted text literal]] (''F-string'' for short) starts with F or f preceding a text literal enclosed in double-quotes. It can include replacement expressions delineated by curly braces, which get replaced by the result of evaluating the expressions -- for example, if x=1 and y=2:&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;The value of x is {x}, y is {y} and their sum is {x+y}&amp;quot; &amp;amp;rarr; 'The value of x is 1, y is 2 and their sum is 3'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could get the same result using [[Text_Concatenation_Operator%3A_%26|text-concatenation]] as&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;quot;The value of x is &amp;quot; &amp;amp; x &amp;amp; &amp;quot;, y is &amp;quot; &amp;amp; y &amp;amp; &amp;quot; and their sum is &amp;quot; &amp;amp; (x+y)&amp;lt;/code&amp;gt;&lt;br /&gt;
but the F-string version is more concise and easier to read.&lt;br /&gt;
&lt;br /&gt;
The names [[Formatted Text Literals]] and [[F-Strings]] are borrowed from [https://docs.python.org/3/reference/lexical_analysis.html?highlight=formatting#formatted-string-literals Python]. [[Formatted Text Literals]] aren't really literals like normal single- or double-quoted text values.  Strictly, they are expressions whose value is determined at evaluation time. But, we use that term because they have the syntactic appearance of literals. &lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
A [[Formatted Text Literals|formatted text literal]]  starts with either &amp;lt;code&amp;gt;F&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;f&amp;quot;&amp;lt;/code&amp;gt;, and ends with &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;. In other words, it is a double-quoted text value prefixed with an upper or lower case F.  There can be no space between the F and the opening quote.  You can insert expressions within the text using curly braces, &amp;lt;code&amp;gt;{expr}&amp;lt;/code&amp;gt;. When it evaluates an F-String, it also evaluates any expressions in curly braces and substitutes in their results.&lt;br /&gt;
&lt;br /&gt;
There is currently no single-quoted version of F-strings in Analytica, so you cannot write &amp;lt;code&amp;gt;f'Something'&amp;lt;/code&amp;gt;.  It must use double quotes is in &amp;lt;code&amp;gt;f&amp;quot;Something&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To embed a double quote (&amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;), or curly brace (&amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;) in the text part of an F-string, you must double the character.  For example, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 F&amp;quot;An F-string has the form F&amp;quot;&amp;quot;some text {{ an expression : format spec }} some more text&amp;quot;&amp;quot;.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which has the content: ''An F-string has the form F&amp;quot;some text { an expression : format spec } some more text&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
When the curly braces are not doubled, the content between them is parsed as an expression.  Optionally, the expression can be followed by a colon (&amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;) and a [[#Format Specifiers|format specifier]].  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;1/3 = {1/3 : %6}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;1/3 = 33.333333%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When you omit a format specifier, the [[Number formats|number format]] for the current expression context is used, i.e., for the current variable or [[User-Defined Function]], which you set using the [[Number formats|number format dialog]].&lt;br /&gt;
&lt;br /&gt;
== Array abstraction ==&lt;br /&gt;
F-strings array abstract in the usual way. When a curly-bracket expression evaluates to an array, it creates a text value for each cell. When you have more than one expression, the indexes of your final result will be the union of the indexes for all the expressions.  For example:&amp;lt;code&amp;gt;&lt;br /&gt;
:[[LocalIndex]] X := 1..9;&lt;br /&gt;
:[[LocalIndex]] Y := 1..9;&lt;br /&gt;
:F&amp;quot;{X} * {Y} = {X*Y}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
returns a 2-D array having 81 cells:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:FstringExampleXxY.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A format specifier is static. It isn't computed and cannot vary along any index, so the same format specifier (if any) applies to every cell of the result.&lt;br /&gt;
&lt;br /&gt;
== Format Specifiers ==&lt;br /&gt;
Format specifiers are optional, but when you want to specify the format, follow your expression with a colon and then with the format specifiers.  F-String format specifiers are terse by design, so as to minimize the distraction from the content and keep your formatted text literal looking as much as possible like the final result.  But being terse, they are also cryptic.  Except for numeric parts, each element of the format is denoted by a single character.  Analytica's format specifiers are similar to Python's, but not quite the same. &lt;br /&gt;
&lt;br /&gt;
You don't need a format specifier when you've set the [[Number formats|Number Format]] of your variable or [[UDF]] to be as you'd like.  Also, you have the option of using [[NumberToText]] around your expression for a more descriptive way to specify the format.&lt;br /&gt;
&lt;br /&gt;
A format specifier can specify the following information:&lt;br /&gt;
* The number format for numeric values&lt;br /&gt;
* Minimum width (in characters) and alignment within that space&lt;br /&gt;
* The date template for date-time values&lt;br /&gt;
All three are optional, or you may specify more than one.&lt;br /&gt;
&lt;br /&gt;
Parts that aren't explicitly specified are inherited from the current variable or [[UDF]]'s number format.&lt;br /&gt;
&lt;br /&gt;
=== Number formats ===&lt;br /&gt;
A number format type can be one of the following characters:&lt;br /&gt;
* &amp;lt;code&amp;gt;S&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;: Suffix&lt;br /&gt;
* &amp;lt;code&amp;gt;E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt;: Exponential&lt;br /&gt;
* &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt;: General&lt;br /&gt;
* &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;: Fixed point&lt;br /&gt;
* &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;: Integer&lt;br /&gt;
* &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;: Percent&lt;br /&gt;
* &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;: Boolean (Prints as True or False)&lt;br /&gt;
* &amp;lt;code&amp;gt;H&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;: Hexadecimal&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;: binary&lt;br /&gt;
&lt;br /&gt;
The type can be followed by the number of digits or decimals, such as &amp;lt;code&amp;gt;G12&amp;lt;/code&amp;gt; for General type with 12 digits.  For suffix, exponential, general, hex and binary types, the number is the number of digits total, for fixed point and percent types it is the number of decimal places.  See [[Number formats]].&lt;br /&gt;
&lt;br /&gt;
The following characters specify additional components of the number format:&lt;br /&gt;
* &amp;lt;code&amp;gt;'!'&amp;lt;/code&amp;gt;: Display full precision&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt;: Show trailing zeros. If you use 0, it needs be separated in some way from the number of digits, such as by a space of '.'.  E.g., F10 is Fixed point with 10 decimals, whereas F1.0 is fixed point with 1 decimal and trailing zeros.&lt;br /&gt;
* &amp;lt;code&amp;gt;,&amp;lt;/code&amp;gt;: Show thousands separators&lt;br /&gt;
* ''space'' or &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;: Ignored characters.{{Release|6.3||&lt;br /&gt;
* &amp;lt;code&amp;gt;'j'&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;'J'&amp;lt;/code&amp;gt; controls whether a [[Complex Numbers|complex number]] with zero imaginary part displays &amp;quot;+0j&amp;quot; or not. &amp;lt;code&amp;gt;'j'&amp;lt;/code&amp;gt; displays it, &amp;lt;code&amp;gt;'J'&amp;lt;/code&amp;gt; does not. (New to [[Analytica 6.3]])}}&lt;br /&gt;
&lt;br /&gt;
A few options not available (if you need these, use [[NumberToText]]) are: Currency symbols, use of parentheses for negative numbers, control of the ordering of currency, sign and digits.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;π={Pi:!}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;π=3.141592653589793&amp;quot;&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;The 25th power of 3 is {3^25:I,}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;The 25th power of 3 is 847,288,609,443&amp;quot;&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;${profit:F2,0}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;$17,343,300.00&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Width and Alignment ===&lt;br /&gt;
When you specify a (minimum) width and alignment, the expression uses at least that number of characters, using spaces to pad unused space.  The alignment character comes first, followed by the width, and both are required. The possible alignment characters are:&lt;br /&gt;
* &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;lt;&amp;lt;/code&amp;gt;: Left align&lt;br /&gt;
* &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;gt;&amp;lt;/code&amp;gt;: Right align&lt;br /&gt;
* &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;: Center align&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;π≈{pi:R10G4}, π/2≈{pi:L10G4}, |π^2≈{pi:C10G4}|&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;π≈&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;3.142, π/2≈1.571&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;, |π^2≈&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;9.87&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;|&amp;quot;&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;Cost=${Cost:I,R15}&amp;quot;&amp;lt;/code&amp;gt;&amp;amp;rarr;[[image:FStringCurrencyLeft.png]]&lt;br /&gt;
:&amp;lt;code&amp;gt;F&amp;quot;Cost={F&amp;quot;${Cost:I,}&amp;quot;:R15}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr;[[image:FStringCurrencyWithNumber.png]]&lt;br /&gt;
&lt;br /&gt;
The last example shows how you can use a nested F-string to produce a fixed-width cost column while keeping the $ attached to the number.&lt;br /&gt;
&lt;br /&gt;
=== Date template ===&lt;br /&gt;
The date template renders date-time values. This can be specified along with a number format, so that when an expression returns an array of values with some dates and some numbers, the number format is used for numbers and the date format for dates.&lt;br /&gt;
&lt;br /&gt;
The date template is preceded by the letter &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;, and then continues to the closing curly brace. The date format therefore must be last and come after any alignment and width or number format.  Any spaces that appear after the D and before curly brace become part of the final text.  The date template specified in an F-string cannot contain curly braces. Otherwise, it uses the same conventions as the date template in the number format dialog.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
* &amp;lt;code&amp;gt;F&amp;quot;The current time is {Today(true):Dhh:mm:ss tt}&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;quot;The current time is 03:31:38 PM&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;F&amp;quot;In the US it is {Today():DMM/dd/yyyy}, but in Europe it is {Today():Ddd/MM/yyyy}.&amp;quot;&amp;lt;/code&amp;gt; &amp;amp;rarr; &lt;br /&gt;
*:::&amp;quot;In the US it is 03/24/2021, but in Europe it is 24/03/2021.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Text_Concatenation_Operator%3A_%26|The text-concatenation operator, &amp;amp;]]&lt;br /&gt;
* [[NumberToText]]&lt;br /&gt;
* [[Number formats]]&lt;br /&gt;
* [[Text values]]&lt;br /&gt;
* [[JoinText]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Other_Procedural_Functions&amp;diff=63308</id>
		<title>Other Procedural Functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Other_Procedural_Functions&amp;diff=63308"/>
		<updated>2025-10-09T16:55:37Z</updated>

		<summary type="html">&lt;p&gt;Max: /* EvaluateScript(t) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica User Guide]]&lt;br /&gt;
[[Category: Functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt; Analytica User Guide &amp;gt; Procedural Programming &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CurrentDataFolder(''folderPath'')==&lt;br /&gt;
&lt;br /&gt;
Sets the current data folder to «folderPath». The '''''current data folder''''' is the folder used by functions that read data files such as [[ReadTextFile]](), [[WriteTextFile]](), and [[SpreadsheetOpen]]() when their filename parameter contains no other path. When starting a model, it is the current model folder that contains the model. Specifying a path as a parameter to the function changes the current data folder to that path. If «folderPath» is omitted, it returns the path to the current data folder. See [[CurrentDataFolder]]().&lt;br /&gt;
&lt;br /&gt;
==CurrentModelFolder(folderPath)==&lt;br /&gt;
&lt;br /&gt;
Sets the current model folder to «folderPath». The '''''current model folder''''' is the folder into which the model (and submodules) are saved, by default. When starting a model, it is the folder containing the model. You can change it by selecting a different folder directly using the folder browser from '''Save as''', or by using this function. If «folderPath» is omitted, it returns the path to the current model folder. See [[CurrentModelFolder]]().&lt;br /&gt;
&lt;br /&gt;
==Evaluate(e)==&lt;br /&gt;
&lt;br /&gt;
If «e» is a text value, [[Evaluate]](e) tries to parse «e» as an Analytica expression, evaluates it, and returns its value. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Evaluate('10M /10') &amp;amp;rarr; 1M&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One use for [[Evaluate]](e) is to convert a number formatted as text into a number it can compute with, for example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Evaluate('1.23456e+10') &amp;amp;rarr; 12.3456G&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If «e» is an expression that generates a text value, it evaluates the expression, and then parses and evaluates the resulting text value. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;(VAR x := 10; Evaluate(x &amp;amp; &amp;quot;+&amp;quot; &amp;amp; x)) &amp;amp;rarr; 20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If «e» is a number or expression that is not a text value, it just returns its value:&lt;br /&gt;
:&amp;lt;code&amp;gt;Evaluate(10M /10) &amp;amp;rarr; 1M&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If «e» is a text value that is not a valid expression — for example, if it has a syntax error — it returns [[Null]].&lt;br /&gt;
&lt;br /&gt;
Like other functions, it evaluates the parameter as mid (deterministic) or prob (probabilistic), according to the context in which it is called.&lt;br /&gt;
&lt;br /&gt;
[[Evaluate]](e) parses and evaluates text «e» in a global context. Thus, «e» cannot refer to local variables, local indexes, or function parameters defined in the definition that uses [[Evaluate]](e). For example, this would give an evaluation error:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := (VAR r := 99; Evaluate('r^2'))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; evaluates to a handle before it is passed to the function, then that object is evaluated and its (mid or sample) value is returned.&lt;br /&gt;
&lt;br /&gt;
===Evaluate and dependencies===&lt;br /&gt;
&lt;br /&gt;
Analytica’s dependency mechanism does not work with variables or functions whose identifiers appear inside the text parameter of [[Evaluate]](). For example, consider:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Evaluate(&amp;quot;F(A)&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable C := F(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initially &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; compute the same value. If you then change the definition of function &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; or variable &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, Analytica’s dependency maintenance ensures that &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; is recomputed when needed using the new definition of &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. But, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; does not know it depends on &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, so is not recomputed, and can become inconsistent with the new values for &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. In rare cases, you might intentionally want to break the dependency, in which case [[Evaluate]]() is appropriate; otherwise, use it only with care.&lt;br /&gt;
&lt;br /&gt;
== InvalidateResult(x) ==&lt;br /&gt;
''(Requires [[Analytica 5.0]] or higher)''&lt;br /&gt;
&lt;br /&gt;
Use [[InvalidateResult]] from an [[OnClick]] or [[OnChange]] event to invalidate a previously computed and cached result for variable «x». This is useful when «x» depends on something random or something that may have changed. For example, if «x» generates some random testing data, you could use this to refresh with a new random sample. If  «x» reads data from an external data source, use this to force it to refresh the data. &lt;br /&gt;
&lt;br /&gt;
You never have to worry about explicitly invalidating results in your model when inputs within the model change. Analytica tracks dependencies and automatically invalidates caches results with an input within the model that it depended on changes. &lt;br /&gt;
&lt;br /&gt;
==EvaluateScript(t)==&lt;br /&gt;
&lt;br /&gt;
This function evaluates a text value &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; as if it was [[Typescript]]. This lets you use Typescript [[Commands]] that aren’t available in expressions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Tip Title=&amp;quot;Tip &amp;quot;&amp;gt;Avoid using [[EvaluateScript]](t) except from event attributes (&amp;lt;code&amp;gt;OnClick&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OnChange&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt;), or functions called from event attributes. This minimizes the danger of undermining the no-side effects rule.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetProcessInfo(item)==&lt;br /&gt;
&lt;br /&gt;
Returns information about the current Analytica process from the Windows operating system. There are a large number of recognized values for «item», and for a complete list see [[GetProcessInfo]](). Some of the possible values for «item» are: &amp;lt;code&amp;gt;&amp;quot;Process ID&amp;quot;, &amp;quot;Thread ID&amp;quot;, &amp;quot;Computer Name&amp;quot;, &amp;quot;User Name&amp;quot;, &amp;quot;Windows Version&amp;quot;, &amp;quot;Command Line&amp;quot;, &amp;quot;Total RAM&amp;quot;, &amp;quot;Total Virtual&amp;quot;, &amp;quot;Free RAM&amp;quot;, &amp;quot;Private Bytes&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;GetProcessInfo(&amp;quot;User Name&amp;quot;) &amp;amp;rarr; &amp;quot;Drice&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also access the value of an environment variable as &amp;lt;code&amp;gt;item: name&amp;lt;/code&amp;gt;.&lt;br /&gt;
:&amp;lt;code&amp;gt;GetProcessInfo(&amp;quot;HOMEPATH”) &amp;amp;rarr; &amp;quot;\Users\Drice&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A few options provide information about Analytica’s state: &amp;lt;code&amp;gt;&amp;quot;User Objects&amp;quot;, &amp;quot;Total Objects&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;GetProcessInfo(&amp;quot;User Objects&amp;quot;) &amp;amp;rarr; 76&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetRegistryValue(root, subfolder, name)==&lt;br /&gt;
&lt;br /&gt;
Reads a value from the Windows system registry. This can be quite useful if you install your Analytica model as part of a larger application, and if your model needs to find certain data files on the user’s computer (for example, for use with [[ShowPdfFile]](), [[ReadTextFile]](), or [[RunConsoleProcess]]()). The locations of those files could be stored in the registry by your installer, so that your model knows where to look. See [[GetRegistryValue]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;GetRegistryValue(&amp;quot;HKEY_CURRENT_USER&amp;quot;, &amp;quot;Software/MyCompany/MyProduct&amp;quot;, &amp;quot;FileLocation&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==IgnoreWarnings(expr)==&lt;br /&gt;
&lt;br /&gt;
Evaluates its parameter «expr», and returns its value, while suppressing most [[warnings]] that might otherwise be displayed during the evaluation. It is useful when you want to evaluate an expression that generates warnings, such as divide by zero, that you know are not important in that context, but you do not want to uncheck the option ''Show Result Warnings'' in the [[Preferences dialog]], because you do want to see warnings that might appear in other parts of the model. See [[IgnoreWarnings]]().&lt;br /&gt;
&lt;br /&gt;
==IsResultComputed(x)==&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if the value of «x» is computed when the function is evaluated. To test whether the sample value of «x» has been computed, use &amp;lt;code&amp;gt;Sample(IsResultComputed(x))&amp;lt;/code&amp;gt;, or to test the mid value use &amp;lt;code&amp;gt;Mid(IsResultComputed(x))&amp;lt;/code&amp;gt;. See [[IsResultComputed]]().&lt;br /&gt;
&lt;br /&gt;
==OpenURL(url)==&lt;br /&gt;
&lt;br /&gt;
Opens «url» in a browser window, using your default browser. See [[OpenURL]]().&lt;br /&gt;
&lt;br /&gt;
==ShowPdfFile(filename)==&lt;br /&gt;
&lt;br /&gt;
Opens «filename» using Adobe Reader or Acrobat if one is installed on this computer and the file is a PDF document. [[ShowPdfFile]]() is most useful when called from a button script, for example, as a way to provide the user of your model with a way to open a user guide for your model.&lt;br /&gt;
&lt;br /&gt;
==Try(expr, catch, ''errorNum'')==&lt;br /&gt;
&lt;br /&gt;
Attempts to evaluate and return the result for «expr». If an evaluation error occurs directly in «expr», or in a [[User-Defined Function]] (UDF) called from «expr», then «catch» is evaluated without reporting the error. See [[Try]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
:&amp;lt;code&amp;gt;Try(COMCreateObject(&amp;quot;MSXML&amp;quot;), catch: Null )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the «catch» expression, you can refer to local variables named &amp;lt;code&amp;gt;ErrorText&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ErrorNumber&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ErrorLocation&amp;lt;/code&amp;gt;, containing information about the error. &amp;lt;code&amp;gt;ErrorLocation&amp;lt;/code&amp;gt; contains a handle to the object where the error occurred. You can re-issue the error from within the catch expression by calling [[ReThrow]](). In some cases, you might want to change the error text to your own by calling [[Error]]().&lt;br /&gt;
&lt;br /&gt;
You may optionally specify specific error numbers to catch using the «errorNum» parameter:&lt;br /&gt;
:&amp;lt;code&amp;gt;Try(COMCreateObject(&amp;quot;MSXML&amp;quot;),&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;errorNum: 42770, 43033, 43034,&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;catch: Error(&amp;quot;You don’t have MSXML installed&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the error number for the «errorNum» parameter, set your catch expression to [[MsgBox]](ErrorNumber) and cause the error to occur. Once you have the number or numbers, reset your «catch» expression as you would like it.&lt;br /&gt;
&lt;br /&gt;
[[Try]]() does not suppress or catch warnings. For that, use [[IgnoreWarnings]]().&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[CurrentDataFolder]]()&lt;br /&gt;
* [[CurrentModelFolder]]()&lt;br /&gt;
* [[Evaluate]]()&lt;br /&gt;
* [[EvaluateScript]]()&lt;br /&gt;
* [[GetProcessInfo]]()&lt;br /&gt;
* [[GetRegistryValue]]()&lt;br /&gt;
* [[IgnoreWarnings]]()&lt;br /&gt;
* [[IsResultComputed]]()&lt;br /&gt;
* [[OpenURL]]()&lt;br /&gt;
* [[ShowPdfFile]]()&lt;br /&gt;
* [[Try]]()&lt;br /&gt;
* [[ReThrow]]()&lt;br /&gt;
* [[System Functions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Dialog Functions / {{PAGENAME}} / Reference sections&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=CopyToClipboard&amp;diff=63190</id>
		<title>CopyToClipboard</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=CopyToClipboard&amp;diff=63190"/>
		<updated>2025-09-12T21:39:44Z</updated>

		<summary type="html">&lt;p&gt;Max: /* CopyToClipboard( content, format, empty ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User-interface functions]]&lt;br /&gt;
&lt;br /&gt;
''New to [[Analytica 6.5]]''&lt;br /&gt;
&lt;br /&gt;
== CopyToClipboard( content'', format, empty'' ) ==&lt;br /&gt;
&lt;br /&gt;
Puts «content» onto the system clipboard so that you can paste it elsewhere into Analytica or another application. It replaces anything previously on the clipboard.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
; content : The data to be placed on the clipboard--usually text, an image, or an [[In-memory binary data terms|in-memory binary data term]].&lt;br /&gt;
; format : (Optional) The name of a format to be posted, such as &amp;quot;text&amp;quot;, &amp;quot;bitmap&amp;quot;, or a custom format name such as &amp;quot;PNG&amp;quot;, &amp;quot;HTML Format&amp;quot;, etc. It is generally not needed when posting text or an image since it figures out the usual formats automatically, but it is need it when posting binary data.&lt;br /&gt;
; empty : (Optional) When omitted or True, it empties the previous content of the clipboard before posting. When False, it adds the format to the content already there. You can use &amp;lt;code&amp;gt;empty:False&amp;lt;/code&amp;gt; to post multiple formats.&lt;br /&gt;
&lt;br /&gt;
== Example usage ==&lt;br /&gt;
&lt;br /&gt;
=== Copying text to the clipboard ===&lt;br /&gt;
&lt;br /&gt;
 [[CopyToClipboard]]( &amp;quot;hello world&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
=== Copying an image to the clipboard ===&lt;br /&gt;
&lt;br /&gt;
 [[Local]] img := [[ReadImageFile]]( &amp;quot;&amp;quot;, true );&lt;br /&gt;
 [[CopyToClipboard]]( img )&lt;br /&gt;
&lt;br /&gt;
If you were to select a PNG file, this would post both a &amp;quot;bitmap&amp;quot; format as well as a &amp;quot;PNG&amp;quot; format.   On the other hand, if you post:&lt;br /&gt;
&lt;br /&gt;
 [[CopyToClipboard]]( img, &amp;quot;PNG&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
it would post only the &amp;quot;PNG&amp;quot; format without the &amp;quot;bitmap&amp;quot; format. Beware that it does not check that your image really is a PNG!  &amp;quot;PNG&amp;quot; is not a standard format, but it is commonly used as a custom format, such that many applications recognize it.&lt;br /&gt;
&lt;br /&gt;
=== Copying HTML format to clipboard ===&lt;br /&gt;
&lt;br /&gt;
A HTML format can be useful when you want to include formatting. However, this is not a standard format. Gmail uses a custom format named &amp;quot;HTML Format&amp;quot;, but it requires more that just HTML content. A header is required before the HTML as illustrated here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Version:0.9&lt;br /&gt;
StartHTML:0000000100&lt;br /&gt;
EndHTML:0000000105&lt;br /&gt;
StartFragment:0000000099&lt;br /&gt;
EndFragment:0000000198&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
	&amp;lt;body&amp;gt;&amp;lt;!--StartFragment--&amp;gt;&lt;br /&gt;
		&amp;lt;h1&amp;gt;Example&amp;lt;/h1&amp;gt;&lt;br /&gt;
		&amp;lt;p&amp;gt;This &amp;lt;i&amp;gt;illustrates&amp;lt;/i&amp;gt; the &amp;lt;code&amp;gt;&amp;quot;HTML Format&amp;quot;&amp;lt;/code&amp;gt; clipboard type used by gmail.&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;!--EndFragment--&amp;gt;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The StartHTML, EndHTML, StartFragment, and EndFragment offsets indicate the positions of the HTML content and the fragment within the clipboard data. The positions are represented by zero-padded 10-digit numbers. The StartFragment and EndFragment comments are also necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Posting multiple formats ==&lt;br /&gt;
&lt;br /&gt;
You can post data in multiple formats. It doesn't even have to be the same content. For example:&lt;br /&gt;
&lt;br /&gt;
 [[Local]] url := &amp;quot;https://analytica.com/wp-content/uploads/2023/07/logo.png&amp;quot;;&lt;br /&gt;
 [[Local]] logo := [[ReadFromURL]]( url );&lt;br /&gt;
 [[CopyToClipboard]]( logo );&lt;br /&gt;
 [[CopyToClipboard]]( url, format: &amp;quot;source_url&amp;quot;, empty:False );&lt;br /&gt;
 [[CopyToClipboard]]( &amp;quot;logo.png&amp;quot;, format: &amp;quot;text&amp;quot;, empty:False )&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Slider&amp;diff=63152</id>
		<title>Slider</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Slider&amp;diff=63152"/>
		<updated>2025-08-31T17:14:56Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Slider( val..., domain, styles, ..., resultIndex, returnRef ) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New to [[Analytica 6.3]]''&lt;br /&gt;
&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[Category:User-interface functions]]&lt;br /&gt;
&lt;br /&gt;
Use this function to create a slider control in a user input node or in an edit table cell. &lt;br /&gt;
&lt;br /&gt;
A slider control has a horizontal track with one or more movable thumbs (a standard UI term) that are used to select a value, an interval, or multiple values. A slider can be continuous or discrete -- a discrete slider limits the thumb to a finite set of positions. Its Domain specifies the space of selectable values and thus determines whether it is continuous or discrete. A slider can also optionally include labels with tick marks.&lt;br /&gt;
&lt;br /&gt;
== Slider( val...'', domain, styles, ..., resultIndex, returnRef'' )==&lt;br /&gt;
&lt;br /&gt;
A slider can have one or more thumbs:&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
! Expression !! !! Control's appearance !! !! Result after evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.5).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Slider(0.5, 0.75)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.5,0.75).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;[0.5, 0.75]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Slider(0.1, 0.5, 0.75)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.1,0.5,0.75).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;[0.1, 0.5, 0.75]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All the parameters after «vals» are optional. If specified, you must use [[Call a function|named-parameter calling syntax]]. See below for details.&lt;br /&gt;
&lt;br /&gt;
The number of value parameters determines the number of thumbs.  It defaults to a &amp;lt;code&amp;gt;[[Continuous]](0,1)&amp;lt;/code&amp;gt; scale, unless you specify a «domain» parameter or Domain attribute.&lt;br /&gt;
&lt;br /&gt;
== To create a slider user input ==&lt;br /&gt;
&lt;br /&gt;
# Enter [[Edit mode]]&lt;br /&gt;
# [[Tutorial%3A_Create_a_model#Creating_variable_nodes|Drag a new Variable or Decision node to the diagram]]&lt;br /&gt;
# Enter a Title, say: &amp;lt;code&amp;gt;Probability of Rain&amp;lt;/code&amp;gt;&lt;br /&gt;
# Press [[image:ToolbarExprButton.png]] to edit its Definition&lt;br /&gt;
# Enter its Definition: &amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt; [[image:GreenCheck.png]]&lt;br /&gt;
# From the the [[Object menu]] (or [[Right mouse button menus|Right-click menu]]) select '''Make User Input Node''' (or press ''Ctrl+m'').&lt;br /&gt;
# [[Tutorial%3A_Create_a_model#Moving_nodes|Drag the user input node]] to your desired location.&lt;br /&gt;
&lt;br /&gt;
The user input node looks like this:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Probability of rain slider.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or if you enter the Definition as &amp;lt;code&amp;gt;Slider(0.5, styles:'LabelsBelow')&amp;lt;/code&amp;gt;, it looks like this:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Probability of rain slider with labels below.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The value(s) ==&lt;br /&gt;
&lt;br /&gt;
The first parameter, «val», is the current value. For example, here the value 0.5 is selected:&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt;  &amp;amp;rarr; [[image:slider(0.5).png]]&lt;br /&gt;
As the user moves the thumb, it changes the value in this first parameter. For example, after dragging the slider, the Definition is now&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.660000026226)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider(0.66).png]]&lt;br /&gt;
It stores continuous values at full precision, so you may see the value saved with many significant digits like this.&lt;br /&gt;
&lt;br /&gt;
The number of values listed determines the number of thumbs in the slider. You create an interval slider by listing two values.&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.5, 0.75)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider(0.5,0.75).png]] &lt;br /&gt;
Here, 0.5 and 0.75 are the current values, which it updates when the user moves a thumb.&lt;br /&gt;
&lt;br /&gt;
== Domain ==&lt;br /&gt;
The domain is the set of values that can you can select with the slider.  You can specify the domain either with the Variable's [[Domain attribute]] or by specifying the «domain» parameter to the Slider function. When no domain is specified, the slider defaults to &amp;lt;code&amp;gt;[[Continuous]](0, 1)&amp;lt;/code&amp;gt;, which allows any value between 0 and 1 to be selected.&lt;br /&gt;
&lt;br /&gt;
=== Using the [[Domain attribute]] ===&lt;br /&gt;
&lt;br /&gt;
Often it's betterto specify the [[Domain attribute]] rather than providing a «domain» parameter since it is easier to see once your UI is displaying the control. You can specify it with the [[Attribute panel]] by selecting '''Domain''' from the [[Attribute panel|Attribute menu]]. [[image:Domain on Attribute Choice.png|top]].&lt;br /&gt;
&lt;br /&gt;
The Domain-type pulldown has these options: [[image:DomainPulldown5.png|top]].&lt;br /&gt;
&lt;br /&gt;
Select [[Continuous]] if you want a continuous slider and specify the lower and upper bounds.&lt;br /&gt;
&lt;br /&gt;
A discrete slider restricts the thumb(s) to a finite set of positions. You can select either [[Integer]], '''Explicit Values''',  or '''Copy from Index'''. You can also compute the domain using '''Expression'''.  This example uses '''Explicit Values''':&lt;br /&gt;
:[[image:Explicit Values for Domain.png]] &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider('Bad', styles:'LabelsBelow')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider from explicit values.png]]&lt;br /&gt;
&lt;br /&gt;
=== Using the «domain» parameter ===&lt;br /&gt;
&lt;br /&gt;
As an alternative to using the [[Domain attribute]], your can specify the domain directly as a parameter to the Slider functon.  If both are specified, the parameter overrides the  attribute. When you pass the domain as a parameter, you ''must'' use a [[Function calls and parameters|name-parameter calling convention]].  These examples show ways to specify the «domain» parameter:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Good', domain: [[Discrete]]('Horrible', 'Bad', 'Neutral', 'Good', 'Excellent') )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Good', domain: ['Horrible', 'Bad', 'Neutral', 'Good', 'Excellent'] )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'D', domain: 'A' .. 'G' )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 23, 54, domain: [[Continuous]](0, 100) )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 4, domain: [[Integer]](1, 5) )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Medium', domain: LMH)&amp;lt;/code&amp;gt;   &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;{ where LMH is an index name }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Return value ==&lt;br /&gt;
&lt;br /&gt;
A slider with one thumb returns its first parameter.  &lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.7)&amp;lt;/code&amp;gt; &amp;amp;rarr; 0.7&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider('C', domain:'A'..'Z')&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;'C'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A slider with two or more thumbs returns a list of the values&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.3, 0.7)&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;[0.3, 0.7]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you provide a «resultIndex», the result is a 1-D array on that index.&lt;br /&gt;
:Index Quantile := &amp;lt;code&amp;gt;[10%, 50%, 90%]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(10,30,80, domain:[[Continuous]](0,200), resultIndex: Quantile)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider resultIndex result.png|top]]&lt;br /&gt;
&lt;br /&gt;
If you pass &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt; to the «returnRef» parameter, a [[reference]] to the result is returned.  &lt;br /&gt;
&lt;br /&gt;
If you have a table of multi-thumb sliders (like interval sliders), then you should return references or use a «resultIndex» for all multi-thumb sliders in the table. Otherwise, each list returned by each multi-thumb slider becomes a separate implicit index, and multiple implicit indexes cannot be combined in the same array.  The use of «returnRef» or «resultIndex» addresses that problem.&lt;br /&gt;
&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
When a slider has 2 or more thumbs, the default is to constrain the ordering of the thumbs so that the left thumb cannot move past the right thumb. You can change this by using &amp;lt;code&amp;gt;styles:'Unordered'&amp;lt;/code&amp;gt; as illustrated here.&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.1, 0.2, 0.4, styles: 'Unordered' )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appearance ==&lt;br /&gt;
&lt;br /&gt;
There are many options (various styles, colors and track height) that alter the appearance sliders. In most cases, you'll want to adopt a consistent color and style scheme for all sliders in your model.  To maintain consistency, you should configure the model-wide defaults and avoid explicitly specifying appearance parameters in the [[Slider]] function calls.  Use the parameters to adjust parameters when you want a particular slider to deviate from the model-wide defaults.&lt;br /&gt;
&lt;br /&gt;
=== Model-wide defaults ===&lt;br /&gt;
To control these model-wide defaults, make sure no node is selected, then use the menus to navigate to&lt;br /&gt;
&lt;br /&gt;
::'''[[Definition menu|Definition]] / System variables / Settings / Slider style defaults / Edit table'''&lt;br /&gt;
&lt;br /&gt;
:[[image:Slider style defaults table.png]]&lt;br /&gt;
&lt;br /&gt;
=== Appearance parameters ===&lt;br /&gt;
&lt;br /&gt;
The «styles» parameter accepts a comma-separated list of text options, as described in the next subsection. The subsection after that lists the numerous color parameters that you can specify.  And finally, «trackHeight» accepts a single positive number, which is the height of the track (in pixels). &lt;br /&gt;
&lt;br /&gt;
==== «Styles» parameter ====&lt;br /&gt;
The «styles» parameter accepts these options:&lt;br /&gt;
; &amp;lt;code&amp;gt;'Needle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Circle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Rectangle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Diamond'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Line'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt;:  The thumb shape.&lt;br /&gt;
; &amp;lt;code&amp;gt;'RoundedEnds'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'FlatEnds'&amp;lt;/code&amp;gt;: The track shape.&lt;br /&gt;
; &amp;lt;code&amp;gt;'LabelsNone'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'LabelsAtEnds'&amp;lt;/code&amp;gt;: Whether and where labels appear.&lt;br /&gt;
; &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'HideSelect'&amp;lt;/code&amp;gt;: Whether the area to the left of a single thumb, or between 2 thumbs, uses «selectColor».&lt;br /&gt;
; &amp;lt;code&amp;gt;'Ordered'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Unordered'&amp;lt;/code&amp;gt;: Whether multiple thumbs can cross over each other.&lt;br /&gt;
&lt;br /&gt;
The options in each group above are mutually exclusive. If you do specify more than one, the one that appears last takes precedence. Multiple styles, one from each each group, can be specified in any order separated by commas, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.2, styles: 'Circle','FlatEnds','LabelsAtEnds','ShowSelect')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider Circle Flat AtEnds LeftSelect.png]]&lt;br /&gt;
&lt;br /&gt;
==== Color parameters ====&lt;br /&gt;
The [[Color parameters|color parameter]] names are&lt;br /&gt;
* &amp;lt;code&amp;gt;trackColor&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;trackOutlineColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;selectColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;thumbOutlineColor&amp;lt;/code&amp;gt;&lt;br /&gt;
Their meaning is illustrated here.&lt;br /&gt;
:[[image:sliderColors.png]]&lt;br /&gt;
&amp;lt;small&amp;gt;(Depicted is &amp;lt;code&amp;gt;Slider( 0.2, 0.7, styles:'ShowSelect', trackColor:0x1000ff00, selectColor:0x200000ff, thumbColor:0x80ff80,0x8080ff, thumbOutlineColor:'red', trackOutlineColor:'Blue')&amp;lt;/code&amp;gt;)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each color parameter value can be specified using a color integer or a color name as described at [[Color parameters]].&lt;br /&gt;
&lt;br /&gt;
Each of the color parameters (&amp;lt;code&amp;gt;trackColor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;trackOutlineColor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;selectColor&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;thumbOutlineColor&amp;lt;/code&amp;gt;), other than &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt;, accepts a single color only. You can pass one or more colors to the &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt; parameter, making it possible to have thumbs with different colors. &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.1,0.3,0.6, thumbColor:'red','white','blue')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider with red white blue thumbs.png]].&lt;br /&gt;
&lt;br /&gt;
=== Thumb shapes ===&lt;br /&gt;
; &amp;lt;code&amp;gt;'Needle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider needle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Circle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider circle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Rectangle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider rectangle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Diamond'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider diamond.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider block.png]]&lt;br /&gt;
:[[image:slider block trackheight20.png]]&lt;br /&gt;
:A block thumb looks better when used with a larger track height (shown are trackheight:8 and trackheight:20), and with &amp;lt;code&amp;gt;style:'FlatEnds'&amp;lt;/code&amp;gt;.&lt;br /&gt;
; &amp;lt;code&amp;gt;'Line'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider line.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider nothumb.png]]&lt;br /&gt;
:[[image:slider nothumb trackheight20.png]]&lt;br /&gt;
:The NoThumb style needs to show the selection (the &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt; style), which it turns on automatically unless you explicitly specify &amp;lt;code&amp;gt;styles:'HideSelect'&amp;lt;/code&amp;gt;.  We think it also work best with a larger track height (shown are trackheight:8 and trackheight:20), and with &amp;lt;code&amp;gt;style:'FlatEnds'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
A slider control can appear with no labels (&amp;lt;code&amp;gt;styles:'LabelsNone'&amp;lt;/code&amp;gt;), with the min and max label at each end (&amp;lt;code&amp;gt;styles:'LabelsAtEnds'&amp;lt;/code&amp;gt;), or with labels below (&amp;lt;code&amp;gt;styles:'LabelsBelow'&amp;lt;/code&amp;gt;) . These examples illustrate a slider with &amp;lt;code&amp;gt;'LabelsAtEnds'&amp;lt;/code&amp;gt; and two sliders with &amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:[[image:slider label styles.png]]&lt;br /&gt;
&lt;br /&gt;
The bottom user input node has its [[Node Style dialog|node style]] set to have the control on the left.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt; the scale is chosen automatically. If some labels don't appear, it is probably because they would overlap if all the labels were shown. Making the slider wider may help. There are no options to manually scale, to control which labels are omitted to prevent overlap, or to control how many continuous tic marks or the increment between them. Also, the auto-scaling has some limitations currently including: (a) When deciding which labels to omit, discrete numeric scales, including Integer ranges, are not interpreted numerically, so it doesn't attempt to select round integers - it simply tries to include as many labels as possible without overlap, (b) It is not date or time aware, so may not display labels on &amp;quot;even&amp;quot; dates.&lt;br /&gt;
&lt;br /&gt;
=== Track end styles ===&lt;br /&gt;
&lt;br /&gt;
Use a &amp;lt;code&amp;gt;'RoundedEnds'&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;'FlatEnds'&amp;lt;/code&amp;gt; style to control the track shape.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'RoundedEnds' )&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider rounded ends.png]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'FlatEnds' )&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider flat ends.png]]&lt;br /&gt;
&lt;br /&gt;
Rounded ends are the out-of-the-box default (although you can change the model-wide default in the ''Slider style defaults'' system variable). We think flat ends work better with the &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt; thumb styles, e.g.,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'Block','FlatEnds','ShowLeftSelect', trackHeight:15, selectColor:'Lime',thumbColor:'LightGreen' )&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;amp;rarr; [[image:Slider block green.png]]&lt;br /&gt;
&lt;br /&gt;
=== Track Height ===&lt;br /&gt;
The track height can change the feel of the slider control substantially. The following compares track heights of 8, 1 and 20.&lt;br /&gt;
:[[image:slider track heights 8 1 20.png]]&lt;br /&gt;
&lt;br /&gt;
Note that when the track height is set to 1, you can't see the trackColor or selectColor, unless you set &amp;lt;code&amp;gt;trackOutlineColor:'Transparent'&amp;lt;/code&amp;gt;. In the second slider above, we see the track outline color.&lt;br /&gt;
&lt;br /&gt;
=== ShowLeftSelect ===&lt;br /&gt;
In the model-wide defaults, the '''ShowLeftSelect''' checkbox controls whether the select color appears to the left of the thumb in the case where the slider has one thumb.  The select color shows up between thumbs for interval sliders even when this is off.  Here we see a slider with this unchecked and then with it checked.&lt;br /&gt;
:[[image:slider HideLeftSelect.png]]&lt;br /&gt;
:[[image:slider ShowLeftSelect.png]]&lt;br /&gt;
&lt;br /&gt;
For an interval slider, the model-wide default does not turn off the selection color between the thumbs.  This interval slider displays the same regardless of whether ShowLeftSelect is on in the model-wide defaults.&lt;br /&gt;
:[[image:slider interval.png]]&lt;br /&gt;
&lt;br /&gt;
The styles parameter options &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'HideSelect'&amp;lt;/code&amp;gt; override the '''ShowLeftSelect''' model-wide setting for one-thumb and interval-sliders alike. &lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(25,64, styles:'HideSelect')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider interval hide select.png]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[User Input nodes]]: &amp;lt;Add  Slider into this page, and also Multichoice&amp;gt;&lt;br /&gt;
* [[Choice]] &amp;lt;Add multichoice into this page&amp;gt;&lt;br /&gt;
* [[Checkbox]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Slider&amp;diff=63151</id>
		<title>Slider</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Slider&amp;diff=63151"/>
		<updated>2025-08-31T17:11:45Z</updated>

		<summary type="html">&lt;p&gt;Max: /* The value(s) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New to [[Analytica 6.3]]''&lt;br /&gt;
&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[Category:User-interface functions]]&lt;br /&gt;
&lt;br /&gt;
Use this function to create a slider control in a user input node or in an edit table cell. &lt;br /&gt;
&lt;br /&gt;
A slider control has a horizontal track with one or more movable thumbs (a standard UI term) that are used to select a value, an interval, or multiple values. A slider can be continuous or discrete -- a discrete slider limits the thumb to a finite set of positions. Its Domain specifies the space of selectable values and thus determines whether it is continuous or discrete. A slider can also optionally include labels with tick marks.&lt;br /&gt;
&lt;br /&gt;
== Slider( val...'', domain, styles, ..., resultIndex, returnRef'' )==&lt;br /&gt;
&lt;br /&gt;
A slider can have one or more thumbs:&lt;br /&gt;
:{| border=&amp;quot;0&amp;quot;&lt;br /&gt;
! Expression !! !! Control's appearance !! !! Result after evaluation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.5).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Slider(0.5, 0.75)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.5,0.75).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;[0.5, 0.75]&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;Slider(0.1, 0.5, 0.75)&amp;lt;/code&amp;gt; || &amp;amp;rarr; || [[image:slider(0.1,0.5,0.75).png]] || &amp;amp;rarr; || &amp;lt;code&amp;gt;[0.1, 0.5, 0.75]&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All parameters after «vals» are optional, but if specified, must be specified with [[Call a function|named-parameter calling syntax]]. The parameters are described in the sections below.&lt;br /&gt;
&lt;br /&gt;
The number of values specified determines the number of thumbs.  Notice that it defaults to a &amp;lt;code&amp;gt;[[Continuous]](0,1)&amp;lt;/code&amp;gt; scale.&lt;br /&gt;
&lt;br /&gt;
== To create a slider user input ==&lt;br /&gt;
&lt;br /&gt;
# Enter [[Edit mode]]&lt;br /&gt;
# [[Tutorial%3A_Create_a_model#Creating_variable_nodes|Drag a new Variable or Decision node to the diagram]]&lt;br /&gt;
# Enter a Title, say: &amp;lt;code&amp;gt;Probability of Rain&amp;lt;/code&amp;gt;&lt;br /&gt;
# Press [[image:ToolbarExprButton.png]] to edit its Definition&lt;br /&gt;
# Enter its Definition: &amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt; [[image:GreenCheck.png]]&lt;br /&gt;
# From the the [[Object menu]] (or [[Right mouse button menus|Right-click menu]]) select '''Make User Input Node''' (or press ''Ctrl+m'').&lt;br /&gt;
# [[Tutorial%3A_Create_a_model#Moving_nodes|Drag the user input node]] to your desired location.&lt;br /&gt;
&lt;br /&gt;
The user input node looks like this:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Probability of rain slider.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or if you enter the Definition as &amp;lt;code&amp;gt;Slider(0.5, styles:'LabelsBelow')&amp;lt;/code&amp;gt;, it looks like this:&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:Probability of rain slider with labels below.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The value(s) ==&lt;br /&gt;
&lt;br /&gt;
The first parameter, «val», is the current value. For example, here the value 0.5 is selected:&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.5)&amp;lt;/code&amp;gt;  &amp;amp;rarr; [[image:slider(0.5).png]]&lt;br /&gt;
As the user moves the thumb, it changes the value in this first parameter. For example, after dragging the slider, the Definition is now&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.660000026226)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider(0.66).png]]&lt;br /&gt;
It stores continuous values at full precision, so you may see the value saved with many significant digits like this.&lt;br /&gt;
&lt;br /&gt;
The number of values listed determines the number of thumbs in the slider. You create an interval slider by listing two values.&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.5, 0.75)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider(0.5,0.75).png]] &lt;br /&gt;
Here, 0.5 and 0.75 are the current values, which it updates when the user moves a thumb.&lt;br /&gt;
&lt;br /&gt;
== Domain ==&lt;br /&gt;
The domain is the set of values that can you can select with the slider.  You can specify the domain either with the Variable's [[Domain attribute]] or by specifying the «domain» parameter to the Slider function. When no domain is specified, the slider defaults to &amp;lt;code&amp;gt;[[Continuous]](0, 1)&amp;lt;/code&amp;gt;, which allows any value between 0 and 1 to be selected.&lt;br /&gt;
&lt;br /&gt;
=== Using the [[Domain attribute]] ===&lt;br /&gt;
&lt;br /&gt;
Often it's betterto specify the [[Domain attribute]] rather than providing a «domain» parameter since it is easier to see once your UI is displaying the control. You can specify it with the [[Attribute panel]] by selecting '''Domain''' from the [[Attribute panel|Attribute menu]]. [[image:Domain on Attribute Choice.png|top]].&lt;br /&gt;
&lt;br /&gt;
The Domain-type pulldown has these options: [[image:DomainPulldown5.png|top]].&lt;br /&gt;
&lt;br /&gt;
Select [[Continuous]] if you want a continuous slider and specify the lower and upper bounds.&lt;br /&gt;
&lt;br /&gt;
A discrete slider restricts the thumb(s) to a finite set of positions. You can select either [[Integer]], '''Explicit Values''',  or '''Copy from Index'''. You can also compute the domain using '''Expression'''.  This example uses '''Explicit Values''':&lt;br /&gt;
:[[image:Explicit Values for Domain.png]] &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider('Bad', styles:'LabelsBelow')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider from explicit values.png]]&lt;br /&gt;
&lt;br /&gt;
=== Using the «domain» parameter ===&lt;br /&gt;
&lt;br /&gt;
As an alternative to using the [[Domain attribute]], your can specify the domain directly as a parameter to the Slider functon.  If both are specified, the parameter overrides the  attribute. When you pass the domain as a parameter, you ''must'' use a [[Function calls and parameters|name-parameter calling convention]].  These examples show ways to specify the «domain» parameter:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Good', domain: [[Discrete]]('Horrible', 'Bad', 'Neutral', 'Good', 'Excellent') )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Good', domain: ['Horrible', 'Bad', 'Neutral', 'Good', 'Excellent'] )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'D', domain: 'A' .. 'G' )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 23, 54, domain: [[Continuous]](0, 100) )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 4, domain: [[Integer]](1, 5) )&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;Slider( 'Medium', domain: LMH)&amp;lt;/code&amp;gt;   &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;{ where LMH is an index name }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Return value ==&lt;br /&gt;
&lt;br /&gt;
A slider with one thumb returns its first parameter.  &lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.7)&amp;lt;/code&amp;gt; &amp;amp;rarr; 0.7&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider('C', domain:'A'..'Z')&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;'C'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A slider with two or more thumbs returns a list of the values&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.3, 0.7)&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;[0.3, 0.7]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you provide a «resultIndex», the result is a 1-D array on that index.&lt;br /&gt;
:Index Quantile := &amp;lt;code&amp;gt;[10%, 50%, 90%]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(10,30,80, domain:[[Continuous]](0,200), resultIndex: Quantile)&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider resultIndex result.png|top]]&lt;br /&gt;
&lt;br /&gt;
If you pass &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt; to the «returnRef» parameter, a [[reference]] to the result is returned.  &lt;br /&gt;
&lt;br /&gt;
If you have a table of multi-thumb sliders (like interval sliders), then you should return references or use a «resultIndex» for all multi-thumb sliders in the table. Otherwise, each list returned by each multi-thumb slider becomes a separate implicit index, and multiple implicit indexes cannot be combined in the same array.  The use of «returnRef» or «resultIndex» addresses that problem.&lt;br /&gt;
&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
When a slider has 2 or more thumbs, the default is to constrain the ordering of the thumbs so that the left thumb cannot move past the right thumb. You can change this by using &amp;lt;code&amp;gt;styles:'Unordered'&amp;lt;/code&amp;gt; as illustrated here.&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.1, 0.2, 0.4, styles: 'Unordered' )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appearance ==&lt;br /&gt;
&lt;br /&gt;
There are many options (various styles, colors and track height) that alter the appearance sliders. In most cases, you'll want to adopt a consistent color and style scheme for all sliders in your model.  To maintain consistency, you should configure the model-wide defaults and avoid explicitly specifying appearance parameters in the [[Slider]] function calls.  Use the parameters to adjust parameters when you want a particular slider to deviate from the model-wide defaults.&lt;br /&gt;
&lt;br /&gt;
=== Model-wide defaults ===&lt;br /&gt;
To control these model-wide defaults, make sure no node is selected, then use the menus to navigate to&lt;br /&gt;
&lt;br /&gt;
::'''[[Definition menu|Definition]] / System variables / Settings / Slider style defaults / Edit table'''&lt;br /&gt;
&lt;br /&gt;
:[[image:Slider style defaults table.png]]&lt;br /&gt;
&lt;br /&gt;
=== Appearance parameters ===&lt;br /&gt;
&lt;br /&gt;
The «styles» parameter accepts a comma-separated list of text options, as described in the next subsection. The subsection after that lists the numerous color parameters that you can specify.  And finally, «trackHeight» accepts a single positive number, which is the height of the track (in pixels). &lt;br /&gt;
&lt;br /&gt;
==== «Styles» parameter ====&lt;br /&gt;
The «styles» parameter accepts these options:&lt;br /&gt;
; &amp;lt;code&amp;gt;'Needle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Circle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Rectangle'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Diamond'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Line'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt;:  The thumb shape.&lt;br /&gt;
; &amp;lt;code&amp;gt;'RoundedEnds'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'FlatEnds'&amp;lt;/code&amp;gt;: The track shape.&lt;br /&gt;
; &amp;lt;code&amp;gt;'LabelsNone'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'LabelsAtEnds'&amp;lt;/code&amp;gt;: Whether and where labels appear.&lt;br /&gt;
; &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;'HideSelect'&amp;lt;/code&amp;gt;: Whether the area to the left of a single thumb, or between 2 thumbs, uses «selectColor».&lt;br /&gt;
; &amp;lt;code&amp;gt;'Ordered'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'Unordered'&amp;lt;/code&amp;gt;: Whether multiple thumbs can cross over each other.&lt;br /&gt;
&lt;br /&gt;
The options in each group above are mutually exclusive. If you do specify more than one, the one that appears last takes precedence. Multiple styles, one from each each group, can be specified in any order separated by commas, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.2, styles: 'Circle','FlatEnds','LabelsAtEnds','ShowSelect')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider Circle Flat AtEnds LeftSelect.png]]&lt;br /&gt;
&lt;br /&gt;
==== Color parameters ====&lt;br /&gt;
The [[Color parameters|color parameter]] names are&lt;br /&gt;
* &amp;lt;code&amp;gt;trackColor&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;trackOutlineColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;selectColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;thumbOutlineColor&amp;lt;/code&amp;gt;&lt;br /&gt;
Their meaning is illustrated here.&lt;br /&gt;
:[[image:sliderColors.png]]&lt;br /&gt;
&amp;lt;small&amp;gt;(Depicted is &amp;lt;code&amp;gt;Slider( 0.2, 0.7, styles:'ShowSelect', trackColor:0x1000ff00, selectColor:0x200000ff, thumbColor:0x80ff80,0x8080ff, thumbOutlineColor:'red', trackOutlineColor:'Blue')&amp;lt;/code&amp;gt;)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each color parameter value can be specified using a color integer or a color name as described at [[Color parameters]].&lt;br /&gt;
&lt;br /&gt;
Each of the color parameters (&amp;lt;code&amp;gt;trackColor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;trackOutlineColor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;selectColor&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;thumbOutlineColor&amp;lt;/code&amp;gt;), other than &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt;, accepts a single color only. You can pass one or more colors to the &amp;lt;code&amp;gt;thumbColor&amp;lt;/code&amp;gt; parameter, making it possible to have thumbs with different colors. &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(0.1,0.3,0.6, thumbColor:'red','white','blue')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider with red white blue thumbs.png]].&lt;br /&gt;
&lt;br /&gt;
=== Thumb shapes ===&lt;br /&gt;
; &amp;lt;code&amp;gt;'Needle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider needle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Circle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider circle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Rectangle'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider rectangle.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Diamond'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider diamond.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider block.png]]&lt;br /&gt;
:[[image:slider block trackheight20.png]]&lt;br /&gt;
:A block thumb looks better when used with a larger track height (shown are trackheight:8 and trackheight:20), and with &amp;lt;code&amp;gt;style:'FlatEnds'&amp;lt;/code&amp;gt;.&lt;br /&gt;
; &amp;lt;code&amp;gt;'Line'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider line.png]]&lt;br /&gt;
; &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[image:slider nothumb.png]]&lt;br /&gt;
:[[image:slider nothumb trackheight20.png]]&lt;br /&gt;
:The NoThumb style needs to show the selection (the &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt; style), which it turns on automatically unless you explicitly specify &amp;lt;code&amp;gt;styles:'HideSelect'&amp;lt;/code&amp;gt;.  We think it also work best with a larger track height (shown are trackheight:8 and trackheight:20), and with &amp;lt;code&amp;gt;style:'FlatEnds'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
A slider control can appear with no labels (&amp;lt;code&amp;gt;styles:'LabelsNone'&amp;lt;/code&amp;gt;), with the min and max label at each end (&amp;lt;code&amp;gt;styles:'LabelsAtEnds'&amp;lt;/code&amp;gt;), or with labels below (&amp;lt;code&amp;gt;styles:'LabelsBelow'&amp;lt;/code&amp;gt;) . These examples illustrate a slider with &amp;lt;code&amp;gt;'LabelsAtEnds'&amp;lt;/code&amp;gt; and two sliders with &amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:[[image:slider label styles.png]]&lt;br /&gt;
&lt;br /&gt;
The bottom user input node has its [[Node Style dialog|node style]] set to have the control on the left.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;code&amp;gt;'LabelsBelow'&amp;lt;/code&amp;gt; the scale is chosen automatically. If some labels don't appear, it is probably because they would overlap if all the labels were shown. Making the slider wider may help. There are no options to manually scale, to control which labels are omitted to prevent overlap, or to control how many continuous tic marks or the increment between them. Also, the auto-scaling has some limitations currently including: (a) When deciding which labels to omit, discrete numeric scales, including Integer ranges, are not interpreted numerically, so it doesn't attempt to select round integers - it simply tries to include as many labels as possible without overlap, (b) It is not date or time aware, so may not display labels on &amp;quot;even&amp;quot; dates.&lt;br /&gt;
&lt;br /&gt;
=== Track end styles ===&lt;br /&gt;
&lt;br /&gt;
Use a &amp;lt;code&amp;gt;'RoundedEnds'&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;'FlatEnds'&amp;lt;/code&amp;gt; style to control the track shape.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'RoundedEnds' )&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider rounded ends.png]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'FlatEnds' )&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:Slider flat ends.png]]&lt;br /&gt;
&lt;br /&gt;
Rounded ends are the out-of-the-box default (although you can change the model-wide default in the ''Slider style defaults'' system variable). We think flat ends work better with the &amp;lt;code&amp;gt;'Block'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'NoThumb'&amp;lt;/code&amp;gt; thumb styles, e.g.,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Slider( 0.3, styles:'Block','FlatEnds','ShowLeftSelect', trackHeight:15, selectColor:'Lime',thumbColor:'LightGreen' )&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;amp;rarr; [[image:Slider block green.png]]&lt;br /&gt;
&lt;br /&gt;
=== Track Height ===&lt;br /&gt;
The track height can change the feel of the slider control substantially. The following compares track heights of 8, 1 and 20.&lt;br /&gt;
:[[image:slider track heights 8 1 20.png]]&lt;br /&gt;
&lt;br /&gt;
Note that when the track height is set to 1, you can't see the trackColor or selectColor, unless you set &amp;lt;code&amp;gt;trackOutlineColor:'Transparent'&amp;lt;/code&amp;gt;. In the second slider above, we see the track outline color.&lt;br /&gt;
&lt;br /&gt;
=== ShowLeftSelect ===&lt;br /&gt;
In the model-wide defaults, the '''ShowLeftSelect''' checkbox controls whether the select color appears to the left of the thumb in the case where the slider has one thumb.  The select color shows up between thumbs for interval sliders even when this is off.  Here we see a slider with this unchecked and then with it checked.&lt;br /&gt;
:[[image:slider HideLeftSelect.png]]&lt;br /&gt;
:[[image:slider ShowLeftSelect.png]]&lt;br /&gt;
&lt;br /&gt;
For an interval slider, the model-wide default does not turn off the selection color between the thumbs.  This interval slider displays the same regardless of whether ShowLeftSelect is on in the model-wide defaults.&lt;br /&gt;
:[[image:slider interval.png]]&lt;br /&gt;
&lt;br /&gt;
The styles parameter options &amp;lt;code&amp;gt;'ShowSelect'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'HideSelect'&amp;lt;/code&amp;gt; override the '''ShowLeftSelect''' model-wide setting for one-thumb and interval-sliders alike. &lt;br /&gt;
:&amp;lt;code&amp;gt;Slider(25,64, styles:'HideSelect')&amp;lt;/code&amp;gt; &amp;amp;rarr; [[image:slider interval hide select.png]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[User Input nodes]]: &amp;lt;Add  Slider into this page, and also Multichoice&amp;gt;&lt;br /&gt;
* [[Choice]] &amp;lt;Add multichoice into this page&amp;gt;&lt;br /&gt;
* [[Checkbox]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiTable&amp;diff=63046</id>
		<title>MultiTable</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiTable&amp;diff=63046"/>
		<updated>2025-08-21T17:56:45Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Dimensionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:User-interface functions]]&lt;br /&gt;
[[category:Top level functions]]&lt;br /&gt;
[[category:Table functions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MultiTable(i1,i2,...)(src1, src2, ...) ==&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] lets you mix editable and computed values in a single table. Editable cells are based on other variables, each defined as a [[Table]] or [[SubTable]]. Computed values are based on calculated variables or expressions.  When you change an editable cell, you are actually changing the original cell in the source table, not a copy.&lt;br /&gt;
&lt;br /&gt;
It is best practice in Analytica to keep different editable user inputs and computed results in different variables. But, it is often convenient to define part of a user interface that combines editable and computed values, which the [[MultiTable]] lets you do.&lt;br /&gt;
&lt;br /&gt;
For example, suppose &amp;lt;code&amp;gt;Startup_cost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Prob_success&amp;lt;/code&amp;gt; are both edit tables, indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;.  Then the a variable defined as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Project_inputs := MultiTable(Item)(Startup_cost, Prob_success)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lets you view and edit both Startup_cost and Prob_Success in the same edit table. The [[MultiTable]] is indexed by &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;, the index common to both Startup_cost and Prob_success, and by &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt;, which is an additional index that needs to be created. &lt;br /&gt;
&lt;br /&gt;
[[MultiTable]] is the inverse of [[SubTable]] in that it combines multiple sources into one view, where [[SubTable]] selects a particular slice or subset of data to edit.&lt;br /&gt;
&lt;br /&gt;
== Creating a MultiTable ==&lt;br /&gt;
&lt;br /&gt;
Before you create a [[MultiTable]], you need to create or identify one or more indexes that your data sources will vary over. For example, if you want a different data source to appear in each column of your table, then you'll need a column index, and you'll need to fill in the labels for each column as you define the index.&lt;br /&gt;
&lt;br /&gt;
Next, create a variable to hold your [[MultiTable]] and press ''Ctrl+E'' to place your cursor in the definition field.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create1.png]]&lt;br /&gt;
&lt;br /&gt;
In the '''Object Finder''', select the '''Array''' library and scroll down to find and select [[MultiTable]]. Then, press the '''Indexes''' button.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create2.png]]&lt;br /&gt;
&lt;br /&gt;
Select the indexes that your [[MultiTable]] data sources will vary along. These are not the indexes of your data sources themselves.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create3.png]]&lt;br /&gt;
&lt;br /&gt;
The table initially displays the &amp;quot;Meta expressions&amp;quot; view so that you can specify the data sources for the table. The ''meta-expression selector'' controls which view you are in. &lt;br /&gt;
&lt;br /&gt;
== Specifying Data Sources ==&lt;br /&gt;
&lt;br /&gt;
Whenever you need to specify or change which data source should appear in a [[MultiTable]], use the ''meta-expressions selector'' to change to '''meta-expressions view'''. &lt;br /&gt;
&lt;br /&gt;
Here is an example of meta-expressions.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create4.png]]&lt;br /&gt;
&lt;br /&gt;
In the above meta-expressions view, &amp;lt;code&amp;gt;Option_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Stock_symbol&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Strike_price&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Expiration_date&amp;lt;/code&amp;gt; are identifiers of other edit tables. These will be editable columns. &amp;lt;code&amp;gt;Stock_price_lookup(Stock_Symbol)&amp;lt;/code&amp;gt; is a call to a [[User-Defined Function]], and its computed value will appear in this column. The last cell contains &amp;lt;code&amp;gt;Mid(Contract_valuation)&amp;lt;/code&amp;gt;, so that the computed mid-value of &amp;lt;code&amp;gt;Contract_valuation&amp;lt;/code&amp;gt; will be displayed. When you want the computed value of a variable, you must surround its identifier with [[Mid]] in this fashion, otherwise its definition will appear in the cell and will be editable.&lt;br /&gt;
&lt;br /&gt;
=== Editable sources ===&lt;br /&gt;
&lt;br /&gt;
An editable source reflects the contents of another edit table in your model, a [[slice]] of an edit table, or the [[definition]] of another variable. When a user edits these cells in the multitable, they are actually changing the data in the specified source definition or table. In meta-expression view, an editable source is specified in one of the following ways.&lt;br /&gt;
* &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; : An identifier. The definition of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, or the [[Table|edit table]] (or [[SubTable]] or [[MultiTable]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;) is depicted.&lt;br /&gt;
* &amp;lt;code&amp;gt;X[I=v]&amp;lt;/code&amp;gt; : A [[Slice]] or [[Subscript]] of another table. That slice is depicted in an editable form.&lt;br /&gt;
&lt;br /&gt;
The source can be a scalar variable, an [[Table|edit table]], a [[SubTable]] or another [[MultiTable]]. Rather arbitrary transformations that be accomplished by nesting SubTables and MultiTables.&lt;br /&gt;
&lt;br /&gt;
=== Computed sources ===&lt;br /&gt;
&lt;br /&gt;
The following are computed expressions, which are evaluated and the resulting value displayed in a non-editable form with a gray background.&lt;br /&gt;
* &amp;lt;code&amp;gt;31.4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;Text&amp;quot;&amp;lt;/code&amp;gt;: Literal values (numbers, quoted text)&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;: Displays the computed mid-value of the variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;F(...)&amp;lt;/code&amp;gt;: Any function call other than [[Slice]] or [[Subscript]], including calls to [[User-Defined Function]]s, are evaluated.&lt;br /&gt;
* &amp;lt;code&amp;gt;x + y&amp;lt;/code&amp;gt; : An expression, such as one involving arithmetic operations, is evaluated.&lt;br /&gt;
&lt;br /&gt;
Here are a few additional examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;  : ''computes and displays the [[mid]]-value of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Abs(X)&amp;lt;/code&amp;gt; : ''displays the [[Abs|absolute value]] of the (mid-value) of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;Mean(X)&amp;lt;/code&amp;gt; : ''computes and displays the [[mean]] of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;''&lt;br /&gt;
* &amp;lt;code&amp;gt;1.2&amp;lt;/code&amp;gt; : ''displays the number, 1.2, in a non-editable cell''&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;Some text&amp;quot;&amp;lt;/code&amp;gt; : ''displays the text, without quotes, in a non-editable cell&lt;br /&gt;
&lt;br /&gt;
A computed expression or computed variable CAN depend on the values of other data sources that appear in the same [[MultiTable]]. When you do this, the computed value will change when the user changes the input cells and presses the green check button.&lt;br /&gt;
&lt;br /&gt;
== Viewing the Data ==&lt;br /&gt;
&lt;br /&gt;
After you have specified the data sources in meta-expression view, change the '''meta-expression selector''' to '''Show Cells''' to see the actual data.&lt;br /&gt;
&lt;br /&gt;
:[[image:MT_create5.png]]&lt;br /&gt;
&lt;br /&gt;
=== When cells can be edited ===&lt;br /&gt;
&lt;br /&gt;
You can never edit computed values in a [[MultiTable]] &lt;br /&gt;
&lt;br /&gt;
In [[Browse mode]], you can edit data in a variable only if the variable has a [[user input node]].  This means that if your [[MultiTable]] variable has a user input node, users in [[Browse mode]] (including [[Analytica Cloud Platform]] or [[Free Edition]]) can edit all table sources.  Otherwise, if one source has a user input node and another does not, users in [[Browse mode]] can edit only those cells from the source(s) with the user in.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of an editable value and computed value in the same table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background:white; border:white; margin-left: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
 Index Base := [&amp;quot;Decimal&amp;quot;, &amp;quot;Hex&amp;quot;]&lt;br /&gt;
 Variable x := 123&lt;br /&gt;
 Variable HexConverter := MultiTable(Base)(x, NumberToText(x, &amp;quot;Hexadecimal&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The edit table displays like this:&lt;br /&gt;
&lt;br /&gt;
:[[image:HexConverter.png]]&lt;br /&gt;
&lt;br /&gt;
The first cell can be edited, and when you change it and press the green check, the [[Binary and hexadecimal integer formats|hexadecimal]] value is computed and displayed.&lt;br /&gt;
&lt;br /&gt;
== Dimensionality ==&lt;br /&gt;
&lt;br /&gt;
The dimensions of the [[MultiTable]] content are the union of the indexes from all sources and of the [[MultiTable]] index(es)--i.e. normal Analytica array abstraction.&lt;br /&gt;
&lt;br /&gt;
A [[MultiTable]] works best when your sources all have the same dimensionality.  When one source does not have an index present in another source, a single cell in the source will map to multiple cells in the [[MultiTable]]; hence, you'll see the same value multiple places, and when you change it, multiple cells will change.  The source retains its original dimensionality, so if the value doesn't vary along an index in the source, it won't vary along that index is the [[MultiTable]].  You may temporarily see a difference in these cells after you first enter a value, but they will become consistent as soon as you press the Green check.&lt;br /&gt;
&lt;br /&gt;
== Number Formats ==&lt;br /&gt;
&lt;br /&gt;
When number formats are set for the source tables, those formats are used in the corresponding column of the MultiTable.&lt;br /&gt;
&lt;br /&gt;
When a meta-expression is of the form &amp;lt;code&amp;gt;Mid(X)&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;'s number format is used. For arbitrary expressions, the number format of the [[MultiTable]]'s own variable is used.&lt;br /&gt;
&lt;br /&gt;
== MultiTable vs. SubTable ==&lt;br /&gt;
&lt;br /&gt;
A [[SubTable]] and [[MultiTable]] are very closely related. Each presents a table view of data that is located in one or more different sources. In each case, the table view can contain a mixture of editable and computed cells. They can even be nested in any combination -- i.e., each source a [[MultiTable]] can be another [[MultiTable]] or another [[SubTable]] (in which cases, the real location of the data is two (or more) steps away). There are cases where you can obtain the same table view using either a [[SubTable]] or a [[MultiTable]]. There are also cases where only one of the two will get you to your desired view (in these cases, it is usually theoretically possible to do it with either, but the wrong choice is excessively complex and inflexible).  This brings up the question -- how do you figure out which one you need to use?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[SubTable]]( expr )&amp;lt;/code&amp;gt; accepts a single expression. The ''expr'' has precisely the same form as one cell expression in a [[MultiTable]]. Thus, one question to ask is: Are you adding a new index (or indexes) to your view that will index the sources? If yes, then you probably want a [[MultiTable]]. If no, then you probably want a [[SubTable]].&lt;br /&gt;
&lt;br /&gt;
The following example illustrates this idea ([[media:MultiTable or SubTable.ana|download this example model]]). You have two source tables, each indexed by &amp;lt;code&amp;gt;Move_num&amp;lt;/code&amp;gt;:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Move_num := [1, 2, 3, 4, 5]&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Whites_move := Table(Move_num)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Blacks_move := Table(Move_num)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The source edit tables contain initially:&lt;br /&gt;
:[[image:whites_moves.png]][[image:blacks_moves.png]]&lt;br /&gt;
&lt;br /&gt;
In the first variation, you want to combine these into an editable move table as follows:&lt;br /&gt;
:[[image:move_table.png]]&lt;br /&gt;
In this variation, the index &amp;lt;code&amp;gt;Side&amp;lt;/code&amp;gt; indexes the source tables, so therefore, [[MultiTable]] is the correct option.&lt;br /&gt;
&lt;br /&gt;
In the second variation, you want to combine these into a linear move sequence as follows:&lt;br /&gt;
:[[image:linear_move_sequence.png]]&lt;br /&gt;
This maps the sources to a new index&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Turn := ['1W', '1B', '2W', '2B', '3W', '3B', '4W', '4B', '5W', '5B' ]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the index, &amp;lt;code&amp;gt;Turn&amp;lt;/code&amp;gt; indirectly indexes the source, but it doesn't directly index the sources. While it is possible to use a [[MultiTable]] with the index &amp;lt;code&amp;gt;Turn&amp;lt;/code&amp;gt;, you would need to insert a separate expression in all 10 cells. If, in the future, you change the maximum number of moves, if take some work to get the new cells to automatically start with the correct cell default. So for this variation, a [[SubTable]] is a much better option than a [[MultiTable]]. One way to define the [[SubTable]] is as&lt;br /&gt;
:&amp;lt;code&amp;gt;[[SubTable]]( [[If]] [[Mod]](@Turn,2)=1 [[Then]] Whites_move[Move_num=Move_num_of_turn] [[Else]] Blacks_move[Move_num=Move_num_of_turn] )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Introduced in [[Analytica 4.6]].  Present in experimental form in [[Analytica 4.5]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* MultiTable and SubTable [https://www.youtube.com/watch?v=q2zqbgsPPBk video tutorial]&lt;br /&gt;
* [[Tutorial: Arrays]]&lt;br /&gt;
* [[Arrays and Indexes]]&lt;br /&gt;
* [[SubTable]]&lt;br /&gt;
* [[Table]]&lt;br /&gt;
* [[Mid]], [[Mean]], [[Sample]] -- used for specifying computed results.&lt;br /&gt;
* [[Subscript]], [[Slice]], [[Subscript/Slice Operator]]&lt;br /&gt;
* [[Objects and Values]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Tornado_charts&amp;diff=62510</id>
		<title>Tornado charts</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Tornado_charts&amp;diff=62510"/>
		<updated>2025-05-20T21:27:13Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Implementing a tornado analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Statistics, Sensitivity, and Uncertainty Analysis &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
A tornado diagram is a common tool used to depict the sensitivity of a result to changes in&lt;br /&gt;
selected variables. It shows the effect on the output of varying each input variable at a time, keeping all the other input variables at their initial (nominal) values. Typically, you choose a “low” and a “high” value for each input. The result is then displayed as a special type of bar graph, with bars for each input variable displaying the variation from the nominal value. It is standard practice to plot the bars horizontally, sorted so that the widest bar is placed at the top. When drawn in this fashion, the diagram takes on the appearance of a tornado, hence its name. The figure below shows a typical tornado diagram.&lt;br /&gt;
&lt;br /&gt;
:[[File:Chapter16_5.png]]&lt;br /&gt;
&lt;br /&gt;
'''Create a tornado analysis:''' To perform a tornado analysis, you must:&lt;br /&gt;
# Select the result or output variable to perform the analysis on.&lt;br /&gt;
# Select the input variables that might affect the output.&lt;br /&gt;
# Decide what the low and high values are to be for each input variable.&lt;br /&gt;
&lt;br /&gt;
'''''Note:''' The input variables do not need to be chance variables. In fact, tornado analysis is often applied to models with no chance variables.''&lt;br /&gt;
&lt;br /&gt;
There are several options for selecting low and high values, including:&lt;br /&gt;
* Selecting the same absolute low and high levels for every input. This usually only makes sense if inputs are very homogeneous with identical nominal values.&lt;br /&gt;
* Selecting absolute low and high values separately for each input variable.&lt;br /&gt;
* Varying all inputs by the same relative amount, e.g., low = 90% of nominal, high = 110% of nominal.&lt;br /&gt;
* Varying all inputs between two given fractiles (aka percentiles, quartiles). This only makes sense if your inputs are uncertain variables. '''Example:''' Low = 10% fractile, High = 90% fractile, nominal = 50% fractile.&lt;br /&gt;
&lt;br /&gt;
==Implementing a tornado analysis==&lt;br /&gt;
&lt;br /&gt;
''For this example, assume we vary all inputs by the same percentage.''&lt;br /&gt;
&lt;br /&gt;
# Create an index variable containing a list of input variable identifiers. Suppose this is called &amp;lt;code&amp;gt;Vars&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Create a variable, &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt;, and define it as a self-indexed table. (To do this, select '''Table''' from the [[expr]] menu, and select self as an index.) From the edit table, set the self-index labels to read low and high. Set the value corresponding to low to 90%, and set the value corresponding to high to 110%.&lt;br /&gt;
#:&lt;br /&gt;
#: [[File:Chapter16_6.png]]&lt;br /&gt;
#:&lt;br /&gt;
#Create a node, &amp;lt;code&amp;gt;Tornado_Analysis&amp;lt;/code&amp;gt;. Assume that the output variable is &amp;lt;code&amp;gt;Net_value&amp;lt;/code&amp;gt;. Define &amp;lt;code&amp;gt;Tornado_Analysis&amp;lt;/code&amp;gt; as:&lt;br /&gt;
#:     &amp;lt;code&amp;gt;WhatIfAll(Net_value, Vars, Level*Vars)&amp;lt;/code&amp;gt;{{Release||4.6|&lt;br /&gt;
&lt;br /&gt;
You can use array abstraction to produce a set of tornado diagrams, with each tornado itself indexed by additional dimensions. Additional dimensions are already included if your output variable is itself an array result, in which case you have a tornado diagram for each element in the output value’s array value.&lt;br /&gt;
&lt;br /&gt;
The [[WhatIfAll]] function is typically the easiest way to implement tornado analysis in Analytica. Note that the third parameter to [[WhatIfAll]] controls the method by which inputs are varied for the analysis. For example:&lt;br /&gt;
&lt;br /&gt;
* For the case where you select the same absolute low and high levels for every input, &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt; would be set to the absolute low and high values, and the third parameter to [[WhatIfAll]] would be simply &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt;.&lt;br /&gt;
* For the case where you select absolute low and high values separately for each input variable, you would index &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;Vars&amp;lt;/code&amp;gt;, fill in &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt;’s table appropriately, then set the third parameter to be just &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt;.&lt;br /&gt;
* And for the case where you vary all inputs between two given fractiles, you would set &amp;lt;code&amp;gt;Level&amp;lt;/code&amp;gt; to the desired fractiles, and use the expression &amp;lt;code&amp;gt;[[GetFract]](Net_value, Level)&amp;lt;/code&amp;gt; as the third parameter.&lt;br /&gt;
&lt;br /&gt;
=== Graphing a tornado ===&lt;br /&gt;
It’s customary to graph a tornado with the names of the input variables are listed down the vertical axis, and the bars displaying the effect on the output horizontally:&lt;br /&gt;
&lt;br /&gt;
# Select '''Show Result''' for the &amp;lt;code&amp;gt;Tornado_Analysis&amp;lt;/code&amp;gt; {{Release||4.6|or &amp;lt;code&amp;gt;Sorted_Tornado&amp;lt;/code&amp;gt;}} variable. Press the '''Graph''' button if necessary.&lt;br /&gt;
# Pivot the index order (if necessary) so that &amp;lt;code&amp;gt;Vars&amp;lt;/code&amp;gt; is on the X-axis and &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; is the &amp;lt;code&amp;gt;Key&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select '''Graph Setup''' and the '''Chart Type''' tab.&lt;br /&gt;
# Set the ''Line Style'' to the filled bar setting and check the ''Variable origin'' checkbox. This will also set ''Bar Overlap'' = 100% and ''Swap horizontal and vertical'' for you. {{Release|5.0||&lt;br /&gt;
# Set the '''Sort by data spread''' checkbox. }}&lt;br /&gt;
# Click '''Apply'''.&lt;br /&gt;
# Next, we want to compare to the baseline value of &amp;lt;code&amp;gt;Net_Value&amp;lt;/code&amp;gt;. Click the '''XY''' button to open the '''XY Comparison Sources''' dialog, check ''Use another variable'', press '''Add...''', and in the '''Object Finder''' select the variable &amp;lt;code&amp;gt;Net_Value&amp;lt;/code&amp;gt;. Press '''OK''' twice.&lt;br /&gt;
# In the Bar Origin pulldown, select &amp;lt;code&amp;gt;Net_value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[GetFract]]&lt;br /&gt;
* [[Tornado Plots]]&lt;br /&gt;
* [[XY Comparison]]&lt;br /&gt;
* [[Graph setup dialog]]&lt;br /&gt;
* [[WhatIfAll]], [[WhatIf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Sensitivity analysis functions / {{PAGENAME}} / X-Y plots&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62509</id>
		<title>Attrib of Obj</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62509"/>
		<updated>2025-05-20T20:41:03Z</updated>

		<summary type="html">&lt;p&gt;Max: /* No auto propagation of changes to attributes other than Definition and Identifier */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Meta-Inference Functions]]&lt;br /&gt;
[[Category:Operators]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
== ''Attrib'' Of ''Obj'' ==&lt;br /&gt;
&lt;br /&gt;
Returns the value of attribute «Attrib» of object «Obj».  «Attrib» and «Obj» may each be an identifier, a text value containing identifiers, or a handle to the attribute or object.  For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF Time &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF 'Time' &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF [[HandleFromIdentifier]]('Time') &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the requested attribute is not set for that object, it returns [[Null]].&lt;br /&gt;
This works if «Attrib» or «Obj» are arrays of attribute or object names or handles.&lt;br /&gt;
&lt;br /&gt;
=== Computing «obj» ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want to use an expression for «obj» rather than just a literal identifier , especially when doing [[Meta-Inference]].  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision A := 'Yes'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Handle(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF B &amp;amp;rarr; Variable&amp;lt;/code&amp;gt;&lt;br /&gt;
You might have expected that the second expression would return &amp;lt;code&amp;gt;Decision&amp;lt;/code&amp;gt;, the class of variable &amp;lt;code&amp;gt;'A'&amp;lt;/code&amp;gt; whose handle is the value of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;. But the parser naturally assumes you want the attribute of the object  &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, not its value. If you want to get the value of the variable or expression in «Obj», you need use an expression that is not just the name of a variable. You can simply put parentheses around the identifier:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (B) &amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be particularly useful if you want to get an attribute of a list of objects:&lt;br /&gt;
:&amp;lt;code&amp;gt;INDEX Vars := ListOfHandles(X, Y, Z)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Vars) &amp;amp;rarr; Array(Vars, [Decision, Variable, Index])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying «attrib» ===&lt;br /&gt;
&lt;br /&gt;
If «attrib» is not simply the identifier of an attribute, it tries to evaluates ot as an expression. «attrib» could be a variable or expression whose value is a text identifier of an Attribute,  a handle to an attribute, or a text value with the identifier of an attribute, or an array of such text identifiers or handles. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Attribs := ['Class', 'Identifier', 'Value']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Attribs OF A&amp;amp;rarr; Array(Attribs, ['Decision', 'A', 'Yes'])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Syntax of &amp;quot;OF&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
You can use '''OF''' to get attributes of a function:&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of the evaluate function, while &lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate('Va1')&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The '''OF'''  operator parses in a right-associative fashion, so that:&lt;br /&gt;
&amp;lt;code&amp;gt;Class OF Value OF B&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
parses as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Value OF B)&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OF''' binds more tightly than [[operators|arithmetic operators]], but less tightly than the [[Subscript/Slice Operator]]. So, for example, to access an attribute of a local index of an object, parens are not necessary:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := 1..2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF I := &amp;quot;A simple index&amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Var A := I^2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF A.I &amp;amp; &amp;quot;=&amp;quot; &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line parses as &lt;br /&gt;
:&amp;lt;code&amp;gt;((Description OF (A.I)) &amp;amp; &amp;quot;=&amp;quot;) &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== To assign a value to an Attribute ==&lt;br /&gt;
&lt;br /&gt;
You can set the value of attributes using the syntax:&lt;br /&gt;
:&amp;lt;code&amp;gt;''attrib'' OF ''obj'' := expr&amp;lt;/code&amp;gt;&lt;br /&gt;
As with the standard [[Assignment Operator :=]], you can use this only in the [[OnClick]] attribute of a Button, [[OnChange]] of a Variable, [[Script]] attribute (obsolete), or a Function called from one of these. You may also assign to an attribute of a [[Local variable]] within a Definition.&lt;br /&gt;
&lt;br /&gt;
You may not assign to read-only attributes, like [[Inputs]], and [[Outputs]]. You can assign a handle to a module [[IsIn]], which has the effect of moving the object into that module. You can assign to the Value of a variable, but that is dangerous because it may be inconsistent with its Definition. &lt;br /&gt;
&lt;br /&gt;
As with the simple construct,  «attrib» OF «obj» described above, «attrib» and «obj» may each be a simple identifier, a text value containing an identifier, or a handle to the attribute or object.  And if «obj» is a variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; containing a handle or text value referring to the object of interest, you must put parentheses around it &amp;lt;code&amp;gt;Title OF (X)&amp;lt;/code&amp;gt; if you want the Title of what &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; refers to instead of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
However, for attribute assignment, «attrib» and «obj» must be atoms, not arrays. It does NOT array abstract.  &lt;br /&gt;
&lt;br /&gt;
For most attributes, «expr» should to evaluate to text,  even in this case where it appears the attribute contains numbers:&lt;br /&gt;
:&amp;lt;code&amp;gt;NodeColor OF Va1 := '16000,8000,65535'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may only assign a text value to the definition attribute, e.g.:&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition OF Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you assign directly to a variable:&lt;br /&gt;
:&amp;lt;code&amp;gt;Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
it sets the definition to the text value &amp;lt;code&amp;gt;'A+B'&amp;lt;/code&amp;gt; (with quotes), rather than the expression &amp;lt;code&amp;gt;A+B&amp;lt;/code&amp;gt; (without quotes) that depends on the values of A and B.&lt;br /&gt;
&lt;br /&gt;
You may assign to attributes of a local index(declared using [[Index..Do]]).&lt;br /&gt;
&lt;br /&gt;
To remove an attribute value, assign [[Null]] to it:&lt;br /&gt;
:&amp;lt;code&amp;gt;Units of Va1 := Null&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note: Internally, Analytica distinguishes between an attribute set to the special value [[Null]], and an attribute that has no value.  However, it is not possible to set an attribute value to [[Null]] from an Analytica expression (although you can set value to lists or arrays containing [[Null]] elements).''&lt;br /&gt;
&lt;br /&gt;
== Changes to attributes other than Definition and Identifier don't auto propagate == &lt;br /&gt;
&lt;br /&gt;
Analytica maintains dependencies between variables specified in their Definitions, as reflected in the influence arrows.  So, when you change the Definition of variable, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it invalidates the value of any variable &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; influenced by &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, and recomputes &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; when needed.  It also automatically propagates any change to an identifier to update any definitions that use that identifier. This also works for CheckAttribute, OnClick, and OnChange attributes. &lt;br /&gt;
&lt;br /&gt;
But not other attributes! So if you (or some Analytica code) change, say, the Units  of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it will not invalidate or recompute &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; if it depends on the Units of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;A := 20&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'KW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B := IF Units OF A = 'KW' THEN 1000*A ELSE IF Units of A = 'MW' THEN 1M*A ELSE A&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Because Units of A are KW }&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'MW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Changing Units of A did not cause B to be recomputed }&lt;br /&gt;
&lt;br /&gt;
{{Release|6.1||&lt;br /&gt;
==Subattributes or Fields ==&lt;br /&gt;
&lt;br /&gt;
Some attributes contain multiple fields separated by commas, including: [[NodeInfo]], [[NodeLocation]], [[NodeSize]], [[DefaultSize]], [[FontStyle]], [[NodeFont]], [[DiagState]], [[WindState]], [[ValueState]], [[OutlinerState]], [[DefnState]], [[NumberFormat]], [[ProbabilityNumberFmt]], [[DensityNumberFormat]], and [[FileInfo]].  We refer to these fields as ''sub-attributes''. For example, the [[NodeLocation]] attribute has three sub-attributes: x, y and z, encoding the x, y location (in pixels) of the center of a node on a diagram, along with its z-index (which determines which nodes appear above of other nodes when they overlap). &lt;br /&gt;
&lt;br /&gt;
You can access each sub-attribute using a special syntax ''«attribute»::«fieldNum»'' or ''«attribute»::«fieldName»''.  &lt;br /&gt;
For example, to obtain the y value of the [[NodeLocation]] of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;, use either &lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
The result is either numeric or Null in this case (no need to use [[ParseNumber]]). Similarly, you can set a sub-attribute within the attribute assignment with either syntax, e.g.,&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1 :{{=}} 200 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1 :{{=}} 200&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Objects and Values]]&lt;br /&gt;
* [[Assignment Operator :=]] &lt;br /&gt;
* [[Handle]] function&lt;br /&gt;
* [[Meta-Inference]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Attributes&amp;diff=62508</id>
		<title>Attributes</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Attributes&amp;diff=62508"/>
		<updated>2025-05-20T20:39:24Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Category:Attributes]]&lt;br /&gt;
(Up to [[Analytica Reference]])&lt;br /&gt;
&lt;br /&gt;
Each Analytica Object consists of a set of Attributes, termed &amp;quot;properties&amp;quot; or &amp;quot;fields&amp;quot; in other computer languages.  Every Object has a Class, Identifier, and Title. Variables also have a Definition and Domain. &lt;br /&gt;
&lt;br /&gt;
You can easily view and edit some attributes in an [[Object window]]  or the [[Attribute panel]] below a Diagram. Other attributes you can see, but not edit directly -- such as, the Value, Inputs and Outputs of a Variable, which Analytica computes from the Definition. &lt;br /&gt;
&lt;br /&gt;
Some attributes apply only to a particular object [[Class]] -- for example, Author and Creation date apply only to a Model or Module; Parameters and Recursive apply only to a Function. There are also many internal attributes that you don't usually see but may affect how the node looks -- such as, Nodeinfo, NodeSize, and Nodefont. &lt;br /&gt;
&lt;br /&gt;
This page first describes common editable Attributes, then non-modifiable Attributes, and finally the many obscure internal Attributes that users rarely need to know about.&lt;br /&gt;
&lt;br /&gt;
== Common attributes ==&lt;br /&gt;
&lt;br /&gt;
These attributes apply to all classes of user-defined objects. You can edit them directly in [[Edit mode]] in the [[Object window]] and [[Attribute panel]]:&lt;br /&gt;
&lt;br /&gt;
===Editable Attributes of all Objects===&lt;br /&gt;
&lt;br /&gt;
;Class: The [[Classes of variables and other objects|class]] of the object, such as Variable, Index, Function, or Module. You may change the Class of an object only to a compatible class: You can change the class of a Variable among these subclasses Chance, Constant, Determ, Decision, Index, Objective, Variable. You may change a [[Modules and Libraries|Module]] among these subclasses Library, FiledLibrary, Model, Module, FiledModule, or Form. You can change a [[Text nodes|Text]] node to a [[Frame node|Frame]] node or back. You can't change the class of a Function, Button, or system object.  In the [[Object window]] or [[Attribute panel]], in Edit mode, the Class appears as a pulldown menu that lets you change it to another compatible Class.&lt;br /&gt;
&lt;br /&gt;
;Identifier: The unique name of the object. An identifier must start with a letter, and contain only letters, digits, or underscore, up to 40 characters. Identifiers are insensitive to case -- but Analytica retains and shows the case originally provided (or adapted from the Object's title). So you can use CamelCase to clarify words in the identifier.&lt;br /&gt;
&lt;br /&gt;
;Title: A word or brief phrase identifying the the object. It usually appears in the diagram node, and in many other places in the user interface. It's best to limit a Title to about 50 characters. By default, it creates an identifier from the first 20 characters of the title, substituting &amp;quot;_&amp;quot; for blank or any character that isn't a letter or digit.&lt;br /&gt;
&lt;br /&gt;
;Description: Text that describes or documents the object. For a variable, it should describe what the quantity represents. For a function, it should describe what value it returns and what parameters it expects. If the definition is not obvious, it should also explain briefly what definition is doing. It should also mention any exceptions, such as what it does if an input or parameter is outside the expected domain.&lt;br /&gt;
&lt;br /&gt;
===Editable attributes of Variables and Functions===&lt;br /&gt;
&lt;br /&gt;
;Units: The units of measurement of a variable, or value returned by a function -- such as &amp;quot;$/year&amp;quot; or &amp;quot;km/hr&amp;quot;. It's best to use abbreviations to keep units within about 10 characters.&lt;br /&gt;
&lt;br /&gt;
;Definition: The expression used to compute the value of a variable or function.&lt;br /&gt;
&lt;br /&gt;
;[[Check Attribute|Check]]: An expression used to test that the computed result value is valid.  If it returns false, it gives a warning. This is helpful to detect errors in user input or complex calculations.  See [[Check Attribute]].&lt;br /&gt;
&lt;br /&gt;
===Non-editable attributes of variables and functions===&lt;br /&gt;
&lt;br /&gt;
These attributes are of variables and functions are visible, but not editable, in the Object window and Attribute panel:&lt;br /&gt;
&lt;br /&gt;
;Inputs: A list of variables and functions used in the definition, after definition has been parsed. Before parsing, it may contain variables and functions from which arrows were drawn.&lt;br /&gt;
&lt;br /&gt;
;Outputs: A list of variables and functions that use this object in their definitions.&lt;br /&gt;
&lt;br /&gt;
;Value: The computed value of the variable (not available for functions). You may displayed  the Value in an Object window, but it is not displayed by default.&lt;br /&gt;
&lt;br /&gt;
;EvaluationTime: The number of CPU seconds that have been spent evaluating or obtaining the value of the variable, or computing the result of the [[User Defined Functions|function]], since the object was created or loaded, or since the [[ResetEvalTimes]] command was last executed.  This timing does not include the time spent evaluating parent values.&lt;br /&gt;
&lt;br /&gt;
;EvaluationTimeAll:  The number of CPU seconds spent in evaluation of the object, including time spent evaluating or obtaining the values of other variables that it depends on.  This is the cumulative time since the object was first created or loaded, or since the [[ResetEvalTimes]] command was last executed.&lt;br /&gt;
&lt;br /&gt;
===Editable attributes of Functions===&lt;br /&gt;
&lt;br /&gt;
;Parameters: A list of the function [[parameters]], enclosed in parentheses. It may include [[parameter qualifiers|qualifiers]] that specify what data type or dimension are expected for each parameter, or whether a parameter is optional or may be repeated. It is good practice to also list the main (non-optional) parameters (without qualifiers) in the title, so users can easily see what parameters it expects from seeing the function node in a diagram.&lt;br /&gt;
&lt;br /&gt;
;Recursive: A boolean, with value 0 (default) or 1, specifies whether the function is recursive -- i.e., it may call itself in its definition, or call another function that calls it (mutually recursive). By default, it is not displayed. You need to set it to be displayed in the [[Attributes dialog]].&lt;br /&gt;
&lt;br /&gt;
===Editable Attributes of Modules===&lt;br /&gt;
&lt;br /&gt;
;Author: The name(s) of the person or people who created this module. When you start a new model, it may automatically fill this in with the name of the owner of the computer, if registered with Windows.&lt;br /&gt;
&lt;br /&gt;
;[[TemplateInput]]: Identifies a single variable within the module that functions at the module's primary input. Drawing an arrow into this module node inserts the origin of the arrow as the definition of this variable. &lt;br /&gt;
&lt;br /&gt;
;[[TemplateOutput]]: Identifies a single variable within the module that serves as the module's primary output.  Drawing an arrow from this module node treats this variable as the origin of the arrow  -- for example, for use as an input to another object. &lt;br /&gt;
&lt;br /&gt;
===Non-editable attributes of modules===&lt;br /&gt;
&lt;br /&gt;
The Module [[class]] includes subclasses Model, Module, Filed Module, Library, Filed Library, and Form. These are attributes of modules that you can see but not edit in the [[Object window]] and [[Attribute panel]]:&lt;br /&gt;
&lt;br /&gt;
;Date (Created): The time and date on which the module was first created.&lt;br /&gt;
&lt;br /&gt;
;Savedate (Last Saved): The time and date on which this model or separately filed module or library was last saved. &lt;br /&gt;
&lt;br /&gt;
;Fileinfo (File info): The directory path and name of the file from which this model was read from or to which it was last saved.&lt;br /&gt;
&lt;br /&gt;
==Hidden attributes==&lt;br /&gt;
&lt;br /&gt;
There are quite a few hidden attributes that you can't usually see in the standard user interface, and almost never need to think about. If needed you can see them in the [[Typescript]] Window.  Type &amp;quot;Profile &amp;lt;identifier&amp;gt;&amp;quot; into the Typescript to see all the attributes of an object. &lt;br /&gt;
&lt;br /&gt;
=== Hidden attributes of Variables and Functions===&lt;br /&gt;
&lt;br /&gt;
;[[NumberFormat]]: The number format parameters specified in the [[Number Format Dialog]] for numbers generated in a variable or function. If absent, it uses the default Number Format.&lt;br /&gt;
:&amp;lt;code&amp;gt;v, format, proxy, zeroes, separators, currency, digits, trailingZeros, currencysymbol, currencyPlacement, datetemplate, fullPrecision, fullDateTemplate, relReqForFullDateTemplate, datesAsNumbers, numbersAsDates, digitsForGeneralFmt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[ProbabilityNumberFmt]]: In a Probability Bands result view, a Cumulative Probability result view, or a Probability mass view for a discrete-valued quantity, probabilities display in addition to values for the underlying variable. For the columns or axes containing probabilities, this attribute holds the number format, which is often different from the underlying variable's number format.&lt;br /&gt;
:&amp;lt;code&amp;gt;v, format, proxy, zeroes, separators, currency, digits, trailingZeros, currencysymbol, currencyPlacement, datetemplate, fullPrecision, fullDateTemplate, relReqForFullDateTemplate, datesAsNumbers, numbersAsDates, digitsForGeneralFmt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[DensityNumberFormat]]: In a Probability Density Result view for a continuous variable, probability density values appear in addition to values for the underlying variable's quantity. This attribute stores the number format used for columns or axes that display probability densities.&lt;br /&gt;
:&amp;lt;code&amp;gt;v, format, proxy, zeroes, separators, currency, digits, trailingZeros, currencysymbol, currencyPlacement, datetemplate, fullPrecision, fullDateTemplate, relReqForFullDateTemplate, datesAsNumbers, numbersAsDates, digitsForGeneralFmt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;FixedDef: The parse-tree (DCODE) from the Definition. It displays as the code, usually with extra parens. &lt;br /&gt;
&lt;br /&gt;
;DisplayInputs: A list of objects among inputs from which arrows are to be displayed. It does not display arrows from Inputs that are not in Displayinputs.&lt;br /&gt;
&lt;br /&gt;
;IsIn: A handle to the module that contains this object. (Null for the top model.)&lt;br /&gt;
&lt;br /&gt;
;[[Aliases]]: A list of handles to any user inputs or user outputs ([FormNode]]) or [[Alias nodes]] for this object. Any object type can have aliases, including Variables, Functions, Modules, and Buttons.&lt;br /&gt;
&lt;br /&gt;
;[[Original]]: The original node of a user input or user output ([[FormNode]]) or [[Alias nodes|Alias node]].  [[Aliases]] attribute contains all the nodes listing it as its Original.&lt;br /&gt;
&lt;br /&gt;
===Hidden attributes of Modules===&lt;br /&gt;
&lt;br /&gt;
;Contains:The list of objects contained in this module.&lt;br /&gt;
&lt;br /&gt;
;Defaultsize:The default node size for new nodes in this module.  It uses the same format as Nodesize. If empty, it inherits the default size from its  parent module. For a Model, it uses the default size from the Analytica initialization.&lt;br /&gt;
&lt;br /&gt;
==Node attributes==&lt;br /&gt;
&lt;br /&gt;
These attributes apply to the visual node that represents an object in its parent influence diagram.  They control the location, size, and appearance of each node.  You can modify some in the [[Diagram window|Diagram view]] (NodeLocation, NodeSize), some in the  [[Node Style dialog]] (NodeFont, NodeInfo), or using the [[Color palette|Color palette dialog]], (NodeColor and NodeFontColor). :&lt;br /&gt;
&lt;br /&gt;
;Nodelocation: The location of the node center in its parent diagram, as x,y,z, where x and y are number of pixels rightwards and downwards from the top-left corner of the diagram.  You can, of course, modify node location by dragging nodes in their diagram. Nodes are displayed in order of z value, which therefore controls which nodes are displayed in front of other nodes. You can send a node back or to the front  by selecting the node and using the [[Right mouse button menus|Right mouse button menus.]]&lt;br /&gt;
&lt;br /&gt;
;Nodesize: The size of the node, as x,y, where x and y are the half width and half height in pixels, i.e. the distance from the node center to each edge. You can change the size of each node in its Diagram dragging the corner boxes around a selected node. You can define the default node sizes in the [[Diagram Style dialog]].&lt;br /&gt;
&lt;br /&gt;
;Nodecolor: The color for this node, as r,g,b, where each color is in the range 0 to 65535. If empty, it uses the default color for this object class. You can modify colors bydirectly by selecting the node in the diagram, and using the [[Color palette]].&lt;br /&gt;
&lt;br /&gt;
;NodeFontColor: Controls the font color of a node in a diagram.  You can modify it from the  [[Color palette#Change the text color of nodes|Color palette]]. The attribute is in RGB format, r,g,b, where each color is in the range 0 to 65535.  &lt;br /&gt;
&lt;br /&gt;
You can see the effects of Nodefont and Nodeinfo in the parent diagram. You can modify them for each node with the [[Node Style dialog]] or set defaults for a model or module with the [[Diagram Style dialog]].&lt;br /&gt;
&lt;br /&gt;
;Nodeinfo: This affects how the node appears.  It has quite a number of fields, all Boolean -- 0 or 1 -- except ''widthOfCtrl''.&lt;br /&gt;
:1&lt;br /&gt;
:: ''inputArrows'': set to 1 to show all input influence arrows or 0 to suppress them&lt;br /&gt;
:: ''outputArrows'': set to 1 to show all output influence arrows or 0 to suppress them&lt;br /&gt;
:: ''label'': set to 1 to show the title (or identifier) in the node, or 0 not to.&lt;br /&gt;
:: ''border'': set to 1 to show the thin border around the node, or 0 not to.&lt;br /&gt;
:: ''fill'': set to 1 to fill the node with selected color, or 0 not to.&lt;br /&gt;
:: ''label'': set to 1 to show the title (or identifier) in the node, or 0 not to.&lt;br /&gt;
:: ''useCustomFont'': set to 1 to use the custom font set in NodeFont, or 0 not to.&lt;br /&gt;
:: ''widthOfCtrl'': For a user input or output node, this specifies the width of the field (for a text or choice menu) or the button for other types.&lt;br /&gt;
:: ''bevel'': set to 1 to show a bevel to make the node appear outdented -- default for button nodes -- or 0 not to.&lt;br /&gt;
:: ''ShowFormIcon'': controls whether the little result mode icon (e.g., &amp;quot;Mid&amp;quot;) displays to the right of the result button or not.&lt;br /&gt;
:: ''Embedded'': is reserved for a future release, where it will specify that the edit table, result view, or module is shown directly on the diagram within the node's rectangular area.&lt;br /&gt;
&lt;br /&gt;
::''Hidden'': is also for a future release, to make the node invisible in its Diagram.&lt;br /&gt;
&lt;br /&gt;
;Nodefont: The node font family and size in points, e.g. Bodoni, 16. If empty, it inherits the default font family and size from the parent diagram module.&lt;br /&gt;
&lt;br /&gt;
;Att_hyperlinkPref: When an index or result table contains a [[handle]] to an object, it shows title of the object as a blue clickable link. When you click a handle link, it shows the object. The number assigned to this attribute controls how it shows the object when you click :&lt;br /&gt;
# Open its Object window&lt;br /&gt;
# Open its parent diagram with the node selected&lt;br /&gt;
# If it's a Module, open its Diagram with nothing selected. Otherwise, Open parent Diagram with the node selected.&lt;br /&gt;
The attribute is inherited: If you set this attribute for a Model, it sets the default for all results.  If you set it on a module, it sets the default for results inside that module.  If you set it for a particular variable, it applies only to that variable.&lt;br /&gt;
&lt;br /&gt;
;Pict: An image shown in the node. You can paste an image into a node, or assign an image in standard formats (.png, jpeg, tiff) to the Pict attribute of a node.&lt;br /&gt;
&lt;br /&gt;
==Window status attributes==&lt;br /&gt;
&lt;br /&gt;
These attributes store the location and size of windows, including the Diagram, Object, and Result window, as applicable to each class of object.&lt;br /&gt;
&lt;br /&gt;
;DiagState: The location and size of the diagram window, where ''x'', ''y'' are location of top left corner, ''w'' and ''h'' are width and height in pixels.  ''b'' is a bit field that stores the diagram style options.  ''t'' is the style for tabs when a tabbed diagram style is selected.  &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;v, x, y, w, h, b, tabs, buttonStyle, customIcon, titleOnly, crumbs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:''v'' is a version number. Should be 2.&lt;br /&gt;
&lt;br /&gt;
:''x'', ''y'' in the coordinate of the top-left corner of the window frame when the window is not maximized, relative to the top-left corner of the ''desk area'' (the gray background area that starts under the toolbar). &lt;br /&gt;
&lt;br /&gt;
:''w, h'' are the width and height of the client area of the window when the window is not maximized. This client are is the area of the window not including the edges around the window, the window title bar, or the attribute panel, but it does include the diagram scroll bars (which have a width and height of 16). In [[Analytica 4.6]] and earlier, the height is from the bottom edge of the title bar to the bottom of the diagram's horizontal scroll bar, and hence, includes the height of the module hierarchy stripe within the total height. In [[Analytica 5.0]], the height starts at the lower edge of the hierarchy stripe -- so it does not include the hierarchy stripe.&lt;br /&gt;
&lt;br /&gt;
:''b'' is a bit field, which is the sum of the following values:&lt;br /&gt;
:* 1 = Show arrows to/from modules&lt;br /&gt;
:* 2 = Show arrows to/from indexes&lt;br /&gt;
:* 4 = Show arrows to/from functions&lt;br /&gt;
:* 8 = Turn off background (i.e., the diagram background will appear white)&lt;br /&gt;
:* 16 = Show dynamic dependency arrows &lt;br /&gt;
:* 32 = Show arrows for dependencies in the Check attribute&lt;br /&gt;
&lt;br /&gt;
:''tabs'' is reserved for a future enhancement (not currently exposed)  It encodes whether the diagram is a tabbed diagram, which side the tabs display on, and which style of tabs are used.  Possible values are:&lt;br /&gt;
:* 0 = (default) Not tabbed&lt;br /&gt;
:* 1 = Tabs on top&lt;br /&gt;
:* 2 = Tabs on bottom&lt;br /&gt;
:* 3 = Tabs on left (vertical text)&lt;br /&gt;
:* 4 = Tabs on right (vertical text)&lt;br /&gt;
:* 5 = Wide tabs on left (horizontal text)&lt;br /&gt;
:* 6 = Wide tabs on right (horizontal text)&lt;br /&gt;
:* 7 = Tabs hidden (e.g. overlays, controlled via button scripts)&lt;br /&gt;
&lt;br /&gt;
:''buttonStyle'' controls how the buttons in input and output nodes display (such as ''Calc'', ''Edit Table'', etc).&lt;br /&gt;
:* 0 = Normal text (default in [[Analytica 5.0]])&lt;br /&gt;
:* 1 = Bolded text (pre-5.0 standard)&lt;br /&gt;
:* 2 = Blank (no label or icon in button)&lt;br /&gt;
:* 3 = Icon&lt;br /&gt;
:* 4 = Bare Icon&lt;br /&gt;
::''buttonStyle'' was introduced in [[Analytica 5.0]]&lt;br /&gt;
&lt;br /&gt;
:''customIcon'' If set to 1, uses the pict of the module or model as the icon for the titlebar.&lt;br /&gt;
&lt;br /&gt;
:''titleOnly'' If set to 1, uses the diagram object's title as the titlebar's title without the prefix &amp;quot;Diagram - &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:''crumbs'' If 0, hides the hierarchy bar from this diagram window only (child diagrams unaffected), &lt;br /&gt;
&lt;br /&gt;
::''customIcon'', ''titleOnly'', and ''crumbs'' were introduced in [[Analytica 6.4]].&lt;br /&gt;
&lt;br /&gt;
;WindState: The location and size of the object window, where X, Y are location of top left corner, W and H are width and height in pixels. v is version number, usually 1. (Applies to all user-defined objects.)&lt;br /&gt;
:&amp;lt;code&amp;gt;v, X, Y, W, H&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;ValueState: &amp;lt;code&amp;gt;v, X, Y, W, H, Graph, U&amp;lt;/code&amp;gt;&lt;br /&gt;
The type, location and size of the result window for a variable, where  X, Y are location of top left corner of the window, W and H are width and height in pixels of the area exclusing the title bar and edges (the actual window size is X+15, Y+38), Graph is 1 if a graph view, 0 if a table view, and U is text defining the uncertainty view. v is version number, usually 1. (Applies only to variables.)&lt;br /&gt;
&lt;br /&gt;
;DefnState: The location and size of an edit table window.&lt;br /&gt;
:&amp;lt;code&amp;gt;v, x, y, w, h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;OutlinerState: The location and size of the outliner window.  This is stored as an attribute of the keyword object named &amp;lt;code&amp;gt;All&amp;lt;/code&amp;gt; and is not saved with the model. &lt;br /&gt;
:&amp;lt;code&amp;gt;v, x, y, w, h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Reformval: Lists the indexes for a multidimensional variable, in sequence defining which index is for rows (x axis), which for columns (key), and the remaining as slicers, from bottom to top. &lt;br /&gt;
&lt;br /&gt;
;Att_usebyprevindex: ???&lt;br /&gt;
&lt;br /&gt;
== Internal Engine Attributes==&lt;br /&gt;
&lt;br /&gt;
=== Att_versionRange ===&lt;br /&gt;
=== Att_canBeIn ===&lt;br /&gt;
&lt;br /&gt;
=== Att_dirties ===&lt;br /&gt;
=== Att_showable ===&lt;br /&gt;
=== Att_saveAlways ===&lt;br /&gt;
=== Att_recordSysFunDependencies ===&lt;br /&gt;
=== Att_Saveable ===&lt;br /&gt;
=== Att_attributeType ===&lt;br /&gt;
=== Att_readOnly ===&lt;br /&gt;
=== Att_domainKids, Att_domainParents ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Interface State Attributes ==&lt;br /&gt;
&lt;br /&gt;
'''Att_resultSlicerState''': &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Att_editSlicerState'''&lt;br /&gt;
&lt;br /&gt;
== Graphing Attributes ==&lt;br /&gt;
&lt;br /&gt;
=== xyExpr ===&lt;br /&gt;
&lt;br /&gt;
Contains one external/exogenous value expression.  Recognized by Analytica 3.1 and earlier, where the expression for the X value in an XY graph was stored.  &lt;br /&gt;
&lt;br /&gt;
=== Att_exogenousValue ===&lt;br /&gt;
&lt;br /&gt;
Holds a list of external values for a result window, which can then be used as graphing dimensions.  Analytica 4.0 allows more than one external value to be brought in for plotting against the primary result of a variable.  This attribute holds a list of expressions -- most commonly, each expression consists of a single variable identifier.&lt;br /&gt;
&lt;br /&gt;
The xyExpr may also contain one addition external expression.  (The reason it is split across two attributes is for greater 3.1 interoperability).&lt;br /&gt;
&lt;br /&gt;
=== Att_indexRange ===&lt;br /&gt;
&lt;br /&gt;
:ver, cat,auto, includezero, log, reverse, incs, min, max, includeSubset, excludeSubset, hideLabels&lt;br /&gt;
where:&lt;br /&gt;
:version : Must be 1 (version)&lt;br /&gt;
:categorical : Categorical flag (1=force categorical interp), opt.&lt;br /&gt;
:auto : Full autoscale flag &lt;br /&gt;
:includezero : force 0 to be in range flag &lt;br /&gt;
:log : log scaling flag&lt;br /&gt;
:reverse : reverse order flag&lt;br /&gt;
:incs : Number of increments&lt;br /&gt;
:min : minimum value for manually scaled axis&lt;br /&gt;
:max : maximum value for manually scaled axis&lt;br /&gt;
:includeSubset : [2,7,8,12]  -- include these items (by position) when using manual scaling.  Brackets included&lt;br /&gt;
:excludeSubset : [3,6,13,17] -- exclude these items when using manual scaling.&lt;br /&gt;
:hideLabels: 1=hide labels for this axis&lt;br /&gt;
&lt;br /&gt;
=== Att_valueRange ===&lt;br /&gt;
&lt;br /&gt;
This attribute is usually contained within the [[GraphSetup]] attribute (except when '''Set Default''' was pressed after configuring the range).&lt;br /&gt;
&lt;br /&gt;
The range for each value is encoded as&lt;br /&gt;
&lt;br /&gt;
:ver, cat,auto, includezero, log, reverse, incs, min, max, includeSubset, excludeSubset, hideLabels&lt;br /&gt;
where:&lt;br /&gt;
:version : Must be 1 (version)&lt;br /&gt;
:categorical : Categorical flag (1=force categorical interp), opt.&lt;br /&gt;
:auto : Full autoscale flag &lt;br /&gt;
:includezero : force 0 to be in range flag &lt;br /&gt;
:log : log scaling flag&lt;br /&gt;
:reverse : reverse order flag&lt;br /&gt;
:incs : Number of increments&lt;br /&gt;
:min : minimum value for manually scaled axis&lt;br /&gt;
:max : maximum value for manually scaled axis&lt;br /&gt;
:includeSubset : [2,7,8,12]  -- include these items (by position) when using manual scaling.  Brackets included&lt;br /&gt;
:excludeSubset : [3,6,13,17] -- exclude these items when using manual scaling.&lt;br /&gt;
:hideLabels: 1=hide labels for this axis&lt;br /&gt;
&lt;br /&gt;
For a given variable identifier, there can be a different range for each slice along a comparison index. These are encoded by joining the different range settings using a pipe separator (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;) and prefixing each slice range with the slice number and colon. For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;1,,1,,0,,20|1:1,,0,,1,,,0.01,0.56,0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first range (&amp;lt;code&amp;gt;1,,1,,0,,20&amp;lt;/code&amp;gt; is for the variable's main value, the second one is prefixed by &amp;quot;1:&amp;quot; and applies to the first comparison slice. In a continuous CDF, PDF or Exceedance plot, this would be the 'X' value (e.g., the probability or density axis), but the 'Y' value is encoded instead on the &amp;lt;code&amp;gt;Graph_*_Valdim&amp;lt;/code&amp;gt; system variable.&lt;br /&gt;
&lt;br /&gt;
For common statistical axis, the attribute is set on special system variables with names having the form &amp;lt;code&amp;gt;Graph_*_Valdim&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;Graph_Pdf_Valdim&amp;lt;/code&amp;gt;. This encodes the range setting for the PDF's density axis.&lt;br /&gt;
&lt;br /&gt;
=== Att_continuousLineStyle ===&lt;br /&gt;
=== Att_categoricaLineStyle ===&lt;br /&gt;
=== Att_stackedBar ===&lt;br /&gt;
=== Att_stackedLine ===&lt;br /&gt;
=== Att_barOverlap ===&lt;br /&gt;
&lt;br /&gt;
=== Graphing Role Attributes ===&lt;br /&gt;
&lt;br /&gt;
These attributes are: '''Att_xRole''', '''Att_yRole''', '''Att_colorRole''', '''Att_symbolRole''', '''Att_symbolSizeRole''', '''Att_originRole'''.&lt;br /&gt;
&lt;br /&gt;
They define the graphing pivot in coordination with the '''reformVal''' attribute.  The settings in these attributes are combined with the current chart type, dimensions present in the current value (or values), etc., and Analytica may adjust the pivot actually shown to create a consistent set of roles.  Since the dimensionality of results can change in Analytica (as upstream dimensions or added or removed, the view type can be changed, or the number of elements in a dimension may change), the exact pivot used the previous time the graph was displayed may no longer be sensible.  However, when possible, the roles defined in these attributes do become the roles used in the graph.&lt;br /&gt;
&lt;br /&gt;
Each of these role attributes can hold values in several possible forms:&lt;br /&gt;
* '''Self''': The keyword Self indicates that the main result fills the role.&lt;br /&gt;
* '''barOrigin''': The attribute name barOrigin indicates that the expression found in the legacy barOrigin attribute fills the role.&lt;br /&gt;
* '''xyExpr''': The attribute name indicates that the expression found in the xyExpr attribute fills the role.&lt;br /&gt;
* ''identifier'' : The identifier indicates that the index having this identifier fills the role.&lt;br /&gt;
* '''Sys_LocalIndex(&amp;quot;''name''&amp;quot;)''': Syntax indicating that the local index having the indicated name is used.&lt;br /&gt;
* '''Sys_CoordIndex(''value'')''' : The slice of the main result corresponding to ''[CoordIndex=value]'' is used, where ''value'' is an element of the coordinate index.&lt;br /&gt;
* 0 : The numeric value zero indicates that the main result is used (same as Self).&lt;br /&gt;
* n &amp;gt; 0:  A positive integer value indicates that an external value is used.  Several exogenous values may be attached to the result view (see '''Att_exogenousValues''' and '''xyExpr''' attributes).  These are numbered, with the xyExpr always being n=1 if present, and then the remaining continuing in order through those listed in Att_exogenousValues, and finally the legacy barOrigin attribute expression coming last.&lt;br /&gt;
* n &amp;lt; 0: A negative integer value identifies a coordinate index slice by position.  The role uses the slice of the main result corresponding to ''[@CoordIndex=abs(n)]''.&lt;br /&gt;
&lt;br /&gt;
Also '''barOrigin'''.&lt;br /&gt;
&lt;br /&gt;
== Table attributes ==&lt;br /&gt;
&lt;br /&gt;
* [[TableCellDefault]]: The default value (or Checkbox or Choice expression) used in a new cell of an Edit table when you add or extend an index of that table.&lt;br /&gt;
&lt;br /&gt;
* [[CorrespondenceMethod]]&lt;br /&gt;
&lt;br /&gt;
==Other attributes==&lt;br /&gt;
; Att_BrowseOnly&lt;br /&gt;
; Att__cloakDefn&lt;br /&gt;
; Att_Dirty&lt;br /&gt;
; Att_Obfuscated&lt;br /&gt;
; Att_recordSet : See [[DbQuery]] for examples of use&lt;br /&gt;
; Att_ResultSliceState&lt;br /&gt;
; Att_rlm_license&lt;br /&gt;
; Att_rlm_licenseobj&lt;br /&gt;
; Att_Showable&lt;br /&gt;
; Att_whenDisallowed&lt;br /&gt;
; [[Att_PreLoadScript]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Manage attributes]]&lt;br /&gt;
* [[Attrib of Obj]]&lt;br /&gt;
* [[Objects and Values]]&lt;br /&gt;
* [[Objects_and_Their_Attributes_-_Part_1_of_3|Objects and Their Attributes]]&lt;br /&gt;
* [[Objects_and_Their_Attributes_-_Part_2_of_3#User-Specified_Attributes|User-Defined Attributes]]&lt;br /&gt;
* [[To edit an attribute]]&lt;br /&gt;
* [[Attribute panel]]&lt;br /&gt;
* [[:Category: Attributes]]&lt;br /&gt;
* [[Domain attribute]]&lt;br /&gt;
* [[Class]]&lt;br /&gt;
* [[Identifier]]&lt;br /&gt;
* [[Optimizer Attributes]]&lt;br /&gt;
* [[Attributes of a function]]&lt;br /&gt;
* [[Check attribute]]&lt;br /&gt;
* [[Classes of variables and other objects]]&lt;br /&gt;
* [[Definitions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62507</id>
		<title>Attrib of Obj</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62507"/>
		<updated>2025-05-20T20:13:48Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Assigning Values to Attributes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Meta-Inference Functions]]&lt;br /&gt;
[[Category:Operators]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
== ''Attrib'' Of ''Obj'' ==&lt;br /&gt;
&lt;br /&gt;
Returns the value of attribute «Attrib» of object «Obj».  «Attrib» and «Obj» may each be an identifier, a text value containing identifiers, or a handle to the attribute or object.  For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF Time &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF 'Time' &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF [[HandleFromIdentifier]]('Time') &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the requested attribute is not set for that object, it returns [[Null]].&lt;br /&gt;
This works if «Attrib» or «Obj» are arrays of attribute or object names or handles.&lt;br /&gt;
&lt;br /&gt;
=== Computing «obj» ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want to use an expression for «obj» rather than just a literal identifier , especially when doing [[Meta-Inference]].  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision A := 'Yes'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Handle(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF B &amp;amp;rarr; Variable&amp;lt;/code&amp;gt;&lt;br /&gt;
You might have expected that the second expression would return &amp;lt;code&amp;gt;Decision&amp;lt;/code&amp;gt;, the class of variable &amp;lt;code&amp;gt;'A'&amp;lt;/code&amp;gt; whose handle is the value of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;. But the parser naturally assumes you want the attribute of the object  &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, not its value. If you want to get the value of the variable or expression in «Obj», you need use an expression that is not just the name of a variable. You can simply put parentheses around the identifier:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (B) &amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be particularly useful if you want to get an attribute of a list of objects:&lt;br /&gt;
:&amp;lt;code&amp;gt;INDEX Vars := ListOfHandles(X, Y, Z)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Vars) &amp;amp;rarr; Array(Vars, [Decision, Variable, Index])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying «attrib» ===&lt;br /&gt;
&lt;br /&gt;
If «attrib» is not simply the identifier of an attribute, it tries to evaluates ot as an expression. «attrib» could be a variable or expression whose value is a text identifier of an Attribute,  a handle to an attribute, or a text value with the identifier of an attribute, or an array of such text identifiers or handles. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Attribs := ['Class', 'Identifier', 'Value']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Attribs OF A&amp;amp;rarr; Array(Attribs, ['Decision', 'A', 'Yes'])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Syntax of &amp;quot;OF&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
You can use '''OF''' to get attributes of a function:&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of the evaluate function, while &lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate('Va1')&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The '''OF'''  operator parses in a right-associative fashion, so that:&lt;br /&gt;
&amp;lt;code&amp;gt;Class OF Value OF B&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
parses as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Value OF B)&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OF''' binds more tightly than [[operators|arithmetic operators]], but less tightly than the [[Subscript/Slice Operator]]. So, for example, to access an attribute of a local index of an object, parens are not necessary:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := 1..2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF I := &amp;quot;A simple index&amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Var A := I^2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF A.I &amp;amp; &amp;quot;=&amp;quot; &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line parses as &lt;br /&gt;
:&amp;lt;code&amp;gt;((Description OF (A.I)) &amp;amp; &amp;quot;=&amp;quot;) &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== To assign a value to an Attribute ==&lt;br /&gt;
&lt;br /&gt;
You can set the value of attributes using the syntax:&lt;br /&gt;
:&amp;lt;code&amp;gt;''attrib'' OF ''obj'' := expr&amp;lt;/code&amp;gt;&lt;br /&gt;
As with the standard [[Assignment Operator :=]], you can use this only in the [[OnClick]] attribute of a Button, [[OnChange]] of a Variable, [[Script]] attribute (obsolete), or a Function called from one of these. You may also assign to an attribute of a [[Local variable]] within a Definition.&lt;br /&gt;
&lt;br /&gt;
You may not assign to read-only attributes, like [[Inputs]], and [[Outputs]]. You can assign a handle to a module [[IsIn]], which has the effect of moving the object into that module. You can assign to the Value of a variable, but that is dangerous because it may be inconsistent with its Definition. &lt;br /&gt;
&lt;br /&gt;
As with the simple construct,  «attrib» OF «obj» described above, «attrib» and «obj» may each be a simple identifier, a text value containing an identifier, or a handle to the attribute or object.  And if «obj» is a variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; containing a handle or text value referring to the object of interest, you must put parentheses around it &amp;lt;code&amp;gt;Title OF (X)&amp;lt;/code&amp;gt; if you want the Title of what &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; refers to instead of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
However, for attribute assignment, «attrib» and «obj» must be atoms, not arrays. It does NOT array abstract.  &lt;br /&gt;
&lt;br /&gt;
For most attributes, «expr» should to evaluate to text,  even in this case where it appears the attribute contains numbers:&lt;br /&gt;
:&amp;lt;code&amp;gt;NodeColor OF Va1 := '16000,8000,65535'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may only assign a text value to the definition attribute, e.g.:&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition OF Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you assign directly to a variable:&lt;br /&gt;
:&amp;lt;code&amp;gt;Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
it sets the definition to the text value &amp;lt;code&amp;gt;'A+B'&amp;lt;/code&amp;gt; (with quotes), rather than the expression &amp;lt;code&amp;gt;A+B&amp;lt;/code&amp;gt; (without quotes) that depends on the values of A and B.&lt;br /&gt;
&lt;br /&gt;
You may assign to attributes of a local index(declared using [[Index..Do]]).&lt;br /&gt;
&lt;br /&gt;
To remove an attribute value, assign [[Null]] to it:&lt;br /&gt;
:&amp;lt;code&amp;gt;Units of Va1 := Null&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note: Internally, Analytica distinguishes between an attribute set to the special value [[Null]], and an attribute that has no value.  However, it is not possible to set an attribute value to [[Null]] from an Analytica expression (although you can set value to lists or arrays containing [[Null]] elements).''&lt;br /&gt;
&lt;br /&gt;
== No auto propagation of changes to attributes other than Definition and Identifier == &lt;br /&gt;
&lt;br /&gt;
Analytica maintains dependencies between variables specified in their Definitions, as reflected in the influence arrows.  So, if you change the definition of variable, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it invalidates the value of any variable &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; that depends on &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, and recomputes &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; when needed.  It also automatically propagates any change to an identifier to update any definitions that use that identifier. This works for CheckAttribute, OnClick, and OnChange attributes. &lt;br /&gt;
But not other attributes! So if you (or some Analytica code) change, say, the Units  of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it will not invalidate or recompute &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; if it depends on the Units of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;A := 20&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'KW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B := IF Units OF A = 'KW' THEN 1000*A ELSE IF Units of A = 'MW' THEN 1M*A ELSE A&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Because Units of A are KW }&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'MW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Changing Units of A did not cause B to be recomputed }&lt;br /&gt;
&lt;br /&gt;
{{Release|6.1||&lt;br /&gt;
==Sub-Attributes ==&lt;br /&gt;
There are several attributes in Analytica that store multiple fields separated by commas, namely these attributes: [[NodeInfo]], [[NodeLocation]], [[NodeSize]], [[DefaultSize]], [[FontStyle]], [[NodeFont]], [[DiagState]], [[WindState]], [[ValueState]], [[OutlinerState]], [[DefnState]], [[NumberFormat]], [[ProbabilityNumberFmt]], [[DensityNumberFormat]], and [[FileInfo]].  We refer to these fields as ''sub-attributes''. For example, the [[NodeLocation]] attribute has three sub-attributes: x, y and z, encoding the x, y location (in pixels) of the center of a node on a diagram, along with its z-index (which determines which nodes appear above of other nodes when they overlap). &lt;br /&gt;
&lt;br /&gt;
When you need to access a sub-attribute, you can do so using a special syntax ''«attribute»::«fieldNum»'' or ''«attribute»::«fieldName»''.  &lt;br /&gt;
For example, to obtain the y value of the [[NodeLocation]] of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;, use either &lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
The result is either numeric or Null in this case (no need to use [[ParseNumber]]). Similarly, to set a sub-attribute, use either syntax within the attribute assignment, e.g.,&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1 :{{=}} 200 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1 :{{=}} 200&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Objects and Values]]&lt;br /&gt;
* [[Assignment Operator :=]] &lt;br /&gt;
* [[Handle]] function&lt;br /&gt;
* [[Meta-Inference]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62506</id>
		<title>Attrib of Obj</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Attrib_of_Obj&amp;diff=62506"/>
		<updated>2025-05-20T20:11:58Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Computing «obj» */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Meta-Inference Functions]]&lt;br /&gt;
[[Category:Operators]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
== ''Attrib'' Of ''Obj'' ==&lt;br /&gt;
&lt;br /&gt;
Returns the value of attribute «Attrib» of object «Obj».  «Attrib» and «Obj» may each be an identifier, a text value containing identifiers, or a handle to the attribute or object.  For example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF Time &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF 'Time' &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;'Units' OF [[HandleFromIdentifier]]('Time') &amp;amp;rarr; 'Years'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the requested attribute is not set for that object, it returns [[Null]].&lt;br /&gt;
This works if «Attrib» or «Obj» are arrays of attribute or object names or handles.&lt;br /&gt;
&lt;br /&gt;
=== Computing «obj» ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you may want to use an expression for «obj» rather than just a literal identifier , especially when doing [[Meta-Inference]].  For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision A := 'Yes'&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Handle(A)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF B &amp;amp;rarr; Variable&amp;lt;/code&amp;gt;&lt;br /&gt;
You might have expected that the second expression would return &amp;lt;code&amp;gt;Decision&amp;lt;/code&amp;gt;, the class of variable &amp;lt;code&amp;gt;'A'&amp;lt;/code&amp;gt; whose handle is the value of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;. But the parser naturally assumes you want the attribute of the object  &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, not its value. If you want to get the value of the variable or expression in «Obj», you need use an expression that is not just the name of a variable. You can simply put parentheses around the identifier:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (B) &amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be particularly useful if you want to get an attribute of a list of objects:&lt;br /&gt;
:&amp;lt;code&amp;gt;INDEX Vars := ListOfHandles(X, Y, Z)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Vars) &amp;amp;rarr; Array(Vars, [Decision, Variable, Index])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying «attrib» ===&lt;br /&gt;
&lt;br /&gt;
If «attrib» is not simply the identifier of an attribute, it tries to evaluates ot as an expression. «attrib» could be a variable or expression whose value is a text identifier of an Attribute,  a handle to an attribute, or a text value with the identifier of an attribute, or an array of such text identifiers or handles. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Attribs := ['Class', 'Identifier', 'Value']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Attribs OF A&amp;amp;rarr; Array(Attribs, ['Decision', 'A', 'Yes'])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Syntax of &amp;quot;OF&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
You can use '''OF''' to get attributes of a function:&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of the evaluate function, while &lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF Evaluate('Va1')&amp;lt;/code&amp;gt;&lt;br /&gt;
returns the description of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The '''OF'''  operator parses in a right-associative fashion, so that:&lt;br /&gt;
&amp;lt;code&amp;gt;Class OF Value OF B&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
parses as:&lt;br /&gt;
:&amp;lt;code&amp;gt;Class OF (Value OF B)&amp;amp;rarr; Decision&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OF''' binds more tightly than [[operators|arithmetic operators]], but less tightly than the [[Subscript/Slice Operator]]. So, for example, to access an attribute of a local index of an object, parens are not necessary:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := 1..2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF I := &amp;quot;A simple index&amp;quot;;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Var A := I^2;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Description OF A.I &amp;amp; &amp;quot;=&amp;quot; &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line parses as &lt;br /&gt;
:&amp;lt;code&amp;gt;((Description OF (A.I)) &amp;amp; &amp;quot;=&amp;quot;) &amp;amp; A&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning Values to Attributes ==&lt;br /&gt;
&lt;br /&gt;
You can set the value of attributes using the syntax:&lt;br /&gt;
:&amp;lt;code&amp;gt;''attrib'' OF ''obj'' := expr&amp;lt;/code&amp;gt;&lt;br /&gt;
As with the standard [[Assignment Operator :=]], you can use this only in the [[OnClick]] attribute of  a Button, [[OnChange]] of a Variable, [[Script]] attribute (obsolete), or a Function called from one of these. You may also assign to an attribute of a [[Local variable]] within a Definition.&lt;br /&gt;
&lt;br /&gt;
You may not assign to read-only attributes, like [[Inputs]], and [[Outputs]]. You can assign a handle to a module [[IsIn]], which has the effect of moving the object into that module. You can assign to the Value of a variable, but that is dangerous because it may be inconsistent with its Definition. &lt;br /&gt;
&lt;br /&gt;
As with the simple construct,  «attrib» OF «obj» described above, «attrib» and «obj» may each be a simple identifier, a text value containing an identifier, or a handle to the attribute or object.  And if «obj» is a variable &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; containing a handle or text value referring to the object of interest, you must put parentheses around it &amp;lt;code&amp;gt;Title OF (X)&amp;lt;/code&amp;gt; if you want the Title of what &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; refers to instead of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; itself.&lt;br /&gt;
&lt;br /&gt;
However, for attribute assignment, «attrib» and «obj» must be atoms, not arrays. It does NOT array abstract.  &lt;br /&gt;
&lt;br /&gt;
For most attributes, «expr» should to evaluate to text,  even in this case where it appears the attribute contains numbers:&lt;br /&gt;
:&amp;lt;code&amp;gt;NodeColor OF Va1 := '16000,8000,65535'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may only assign a text value to the definition attribute, e.g.:&lt;br /&gt;
:&amp;lt;code&amp;gt;Definition OF Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you assign directly to a variable:&lt;br /&gt;
:&amp;lt;code&amp;gt;Va1 := &amp;quot;A + B&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
it sets the definition to the text value &amp;lt;code&amp;gt;'A+B'&amp;lt;/code&amp;gt; (with quotes), rather than the expression &amp;lt;code&amp;gt;A+B&amp;lt;/code&amp;gt; (without quotes) that depends on the values of A and B.&lt;br /&gt;
&lt;br /&gt;
You may assign to attributes of a local index(declared using [[Index..Do]]).&lt;br /&gt;
&lt;br /&gt;
To remove an attribute value, assign [[Null]] to it:&lt;br /&gt;
:&amp;lt;code&amp;gt;Units of Va1 := Null&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Note: Internally, Analytica distinguishes between an attribute set to the special value [[Null]], and an attribute that has no value.  However, it is not possible to set an attribute value to [[Null]] from an Analytica expression (although you can set value to lists or arrays containing [[Null]] elements).''&lt;br /&gt;
&lt;br /&gt;
== No auto propagation of changes to attributes other than Definition and Identifier == &lt;br /&gt;
&lt;br /&gt;
Analytica maintains dependencies between variables specified in their Definitions, as reflected in the influence arrows.  So, if you change the definition of variable, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it invalidates the value of any variable &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; that depends on &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, and recomputes &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; when needed.  It also automatically propagates any change to an identifier to update any definitions that use that identifier. This works for CheckAttribute, OnClick, and OnChange attributes. &lt;br /&gt;
But not other attributes! So if you (or some Analytica code) change, say, the Units  of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, it will not invalidate or recompute &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; if it depends on the Units of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;A := 20&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'KW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B := IF Units OF A = 'KW' THEN 1000*A ELSE IF Units of A = 'MW' THEN 1M*A ELSE A&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Because Units of A are KW }&lt;br /&gt;
:&amp;lt;code&amp;gt;Units OF A := 'MW'&amp;lt;/code&amp;gt; &lt;br /&gt;
:&amp;lt;code&amp;gt;B &amp;amp;rarr; 20000&amp;lt;/code&amp;gt; { Changing Units of A did not cause B to be recomputed }&lt;br /&gt;
&lt;br /&gt;
{{Release|6.1||&lt;br /&gt;
==Sub-Attributes ==&lt;br /&gt;
There are several attributes in Analytica that store multiple fields separated by commas, namely these attributes: [[NodeInfo]], [[NodeLocation]], [[NodeSize]], [[DefaultSize]], [[FontStyle]], [[NodeFont]], [[DiagState]], [[WindState]], [[ValueState]], [[OutlinerState]], [[DefnState]], [[NumberFormat]], [[ProbabilityNumberFmt]], [[DensityNumberFormat]], and [[FileInfo]].  We refer to these fields as ''sub-attributes''. For example, the [[NodeLocation]] attribute has three sub-attributes: x, y and z, encoding the x, y location (in pixels) of the center of a node on a diagram, along with its z-index (which determines which nodes appear above of other nodes when they overlap). &lt;br /&gt;
&lt;br /&gt;
When you need to access a sub-attribute, you can do so using a special syntax ''«attribute»::«fieldNum»'' or ''«attribute»::«fieldName»''.  &lt;br /&gt;
For example, to obtain the y value of the [[NodeLocation]] of &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt;, use either &lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1&amp;lt;/code&amp;gt;&lt;br /&gt;
The result is either numeric or Null in this case (no need to use [[ParseNumber]]). Similarly, to set a sub-attribute, use either syntax within the attribute assignment, e.g.,&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::2 of Va1 :{{=}} 200 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NodeLocation::y of Va1 :{{=}} 200&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Objects and Values]]&lt;br /&gt;
* [[Assignment Operator :=]] &lt;br /&gt;
* [[Handle]] function&lt;br /&gt;
* [[Meta-Inference]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiResult&amp;diff=62213</id>
		<title>MultiResult</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiResult&amp;diff=62213"/>
		<updated>2025-02-05T21:49:15Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multiresult lets a [[User-Defined Function]] or expression return more than one distinct value.  It is also convenient in some loops when you want to set multiple local variables at the same time.&lt;br /&gt;
&lt;br /&gt;
== MultiResult( expr ... ) ==&lt;br /&gt;
== _( expr ... ) ==&lt;br /&gt;
&lt;br /&gt;
These two equivalent functions accept repeated expressions separated by commas. It evaluates the only the ones that are captured by the caller or parent expression, and returns the results as multiple distinct return values. The dimensions of each return value are kept distinct -- they are not combined in any way as they would in other functions.  &amp;lt;code&amp;gt;MultiResult(a,b,c)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_(a,b,c)&amp;lt;/code&amp;gt; are identical in functionality.  Stylistically, the &amp;lt;code&amp;gt;MultiResult(...)&amp;lt;/code&amp;gt; syntax is generally nicer when used for a UDF return value, and the &amp;lt;code&amp;gt;_(...)&amp;lt;/code&amp;gt; notation lends itself to looping constructs.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
This function returns the R, G, B and Alpha components as separate results given a color integer c.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:Function ColorComponents(c: Color ) := &lt;br /&gt;
::[[MultiResult]]( &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 16), 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 8), 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ c, 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 24), 0xFF] ) )&lt;br /&gt;
&amp;lt;/code&amp;gt;You can then capture the separate return values in local values using, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (r,g,b,a) := ColorComponents( 'Turquoise' );&amp;lt;/code&amp;gt;&lt;br /&gt;
When you don't need the alpha value, &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (r,g,b) := ColorComponents( 'Turquoise' );&amp;lt;/code&amp;gt;&lt;br /&gt;
In this case, the final expression &amp;lt;code&amp;gt;[[BitAnd]]( [ [[BitShift]]( c, 24), 0xFF] )&amp;lt;/code&amp;gt; in the UDF does not get evaluated.&lt;br /&gt;
&lt;br /&gt;
The next example illustrates its use in a looping construct.  Here &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is indexed by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;, but the «bodyExpr» does something where it requires &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; to be indexed only by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt;.  At the same time, it also needs to know the corresponding index value from &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; for that slice of &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( vi[Time], i[ ] ) := _( v, In1);&amp;lt;/code&amp;gt;&lt;br /&gt;
:''«bodyExpr»''&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Added in release 5.2.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Local]]&lt;br /&gt;
* [[User-Defined Functions]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiResult&amp;diff=62212</id>
		<title>MultiResult</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiResult&amp;diff=62212"/>
		<updated>2025-02-05T21:44:54Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multiresult lets a [[User-Defined Function]] or expression return more than one distinct value.  It is also convenient in some loops when you want to set multiple local variables at the same time.&lt;br /&gt;
&lt;br /&gt;
== MultiResult( expr ... ) ==&lt;br /&gt;
== _( expr ... ) ==&lt;br /&gt;
&lt;br /&gt;
These two equivalent functions accept repeated expressions separated by commas. It evaluates the only the ones that are captured by the caller or parent expression, and returns the results as multiple distinct return values. The dimensions of each return value are kept distinct -- they are not combined in any way as they would in other functions.  &amp;lt;code&amp;gt;MultiResult(a,b,c)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_(a,b,c)&amp;lt;/code&amp;gt; are identical in functionality.  Stylistically, the &amp;lt;code&amp;gt;MultiResult(...)&amp;lt;/code&amp;gt; syntax is generally nicer when used for a UDF return value, and the &amp;lt;code&amp;gt;_(...)&amp;lt;/code&amp;gt; notation lends itself to looping constructs.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
This function returns the R, G, B and Alpha components as separate results given a color integer c.&lt;br /&gt;
&lt;br /&gt;
:Function ColorComponents(c: Color ) := &amp;lt;code&amp;gt;&lt;br /&gt;
::[[MultiResult]]( &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 16), 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 8), 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ c, 0xFF] ), &lt;br /&gt;
:::[[BitAnd]]( [ [[BitShift]]( c, 24), 0xFF] ) )&lt;br /&gt;
&amp;lt;/code&amp;gt;You can then capture the separate return values in local values using, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (r,g,b,a) := ColorComponents( 'Turquoise' );&amp;lt;/code&amp;gt;&lt;br /&gt;
When you don't need the alpha value, &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (r,g,b) := ColorComponents( 'Turquoise' );&amp;lt;/code&amp;gt;&lt;br /&gt;
In this case, the final expression &amp;lt;code&amp;gt;[[BitAnd]]( [ [[BitShift]]( c, 24), 0xFF] )&amp;lt;/code&amp;gt; in the UDF does not get evaluated.&lt;br /&gt;
&lt;br /&gt;
The next example illustrates its use in a looping construct.  Here &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is indexed by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt;, but the «bodyExpr» does something where it requires &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; to be indexed only by &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt;.  At the same time, it also needs to know the corresponding index value from &amp;lt;code&amp;gt;In1&amp;lt;/code&amp;gt; for that slice of &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( vi[Time], i[ ] ) := _( v, In1);&amp;lt;/code&amp;gt;&lt;br /&gt;
:''«bodyExpr»''&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Added in release 5.2.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Local]]&lt;br /&gt;
* [[User-Defined Functions]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=MultiChoice&amp;diff=62211</id>
		<title>MultiChoice</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=MultiChoice&amp;diff=62211"/>
		<updated>2025-02-05T21:41:29Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Filtering long MultiChoice lists (ACP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[Category: Menus]]&lt;br /&gt;
[[Category:User-interface functions]]&lt;br /&gt;
[[Category:Analytica 5.0]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
''New to [[Analytica 5.0]]''&lt;br /&gt;
&lt;br /&gt;
== MultiChoice( &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;'', n..., allowNone, separator, returnList, returnSet{{Release|6.4||, labels, selectionLabels, nestUnder}}'' ) ==&lt;br /&gt;
&lt;br /&gt;
[[image:MultiChoice popup.png|frame|A user-input control showing the [[MultiChoice]] popup with separators and multiple items selected.]]&lt;br /&gt;
&lt;br /&gt;
[[MultiChoice]] creates a user-input control that lets you select one, none, some, or All from a list of options, unlike the similar  [[Choice]] control that lets you select only one or All.  It returns the list of selected options.  [[MultiChoice]] must appear as the top-level of a [[Definition]] or in a [[Table]]. In a [[Table]], it returns a [[Sets - collections of unique elements|Set]] -- a [[reference]] to a list of the selected values,&lt;br /&gt;
&lt;br /&gt;
It doesn't work as a user input when the legacy [[Preferences|Preference setting]] '''Domain acts as self index''' is on.  &lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
* «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;»: Either an index identifier, or the keyword [[Self]]. When it is an index identifier, the index elements are the possible options. When the keyword [[Self]] is used, the possible options are obtained from the [[Domain]].&lt;br /&gt;
* «n»: The currently selected options, listed by position. For example, &amp;lt;code&amp;gt;MultiChoice( I, 2, 3, 7 )&amp;lt;/code&amp;gt; records that the 2&amp;lt;sup&amp;gt;nd&amp;lt;/sup&amp;gt;, 3&amp;lt;sup&amp;gt;rd&amp;lt;/sup&amp;gt;, and 7&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; items are selected.&lt;br /&gt;
* «allowNone»: (Optional) A Boolean that specifies whether the empty selection is allowed. By default, the empty selection is disallowed. To allow the empty selection, use named-parameter syntax, e.g., &amp;lt;code&amp;gt;MultiChoice(Self, allowNone:True)&amp;lt;/code&amp;gt;. When the empty selection is disallowed and «n» contains no valid options, the first item is returned.&lt;br /&gt;
* «separator»: (Optional) When an element in the list of options matches the value specified here, it displays as a non-selectable separator (a horizontal line between items).&lt;br /&gt;
* «returnList»: (Optional) When true, returns a list even when a single item is selected. It that case, the result is a one-element list. This is useful when you define an index with the Multichoice.  When «returnList» is false or omitted, «returnSet» is not true, and only a single item is selected, then the single item is returned. &lt;br /&gt;
* «returnSet»: (Optional) When true, returns a reference to a list (i.e., a [[Set Functions|set]]). When [[MultiChoice]] appears in a table cell, this is the default, since it avoids the combination of dimensions from every cell with a multichoice selector.{{Release|6.4||&lt;br /&gt;
* «labels»: (Optional) The values that appears on the popup menu (or as the selected value on the control if «selectionLabels» isn't also specified). Use this parameter if you want these to be different from the index values (the result). This should be indexed by «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;», or can be a list when using a Self-choice. These can be (thumbnail) images.&lt;br /&gt;
* «selectionLabels»: (Optional) The values that you want to appear in the control as the selected value. This should be indexed by «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;», or can be a list when using a Self-choice. Specify this when you want this to be different from «labels». These can be (thumbnail) images.&lt;br /&gt;
* «nestUnder»: (Optional) A 1-D array indexed by «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;» of submenu names (or Null). When specified, the options are organized hierarchically as submenus. Multiple submenu levels can be separated by the '&amp;amp;gt;' character, for example &amp;lt;code&amp;gt;&amp;quot;California &amp;amp;gt; Santa Clara Co.&amp;quot;&amp;lt;/code&amp;gt; would place the corresponding item two levels deep.}}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
In these examples, the index &amp;lt;code&amp;gt;Option&amp;lt;/code&amp;gt; contains the possible choices. &lt;br /&gt;
:&amp;lt;code&amp;gt;Index Option := ['Apple', 'Pear', 'Orange']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Multichoice with one option selected returns the value of that option:&lt;br /&gt;
:&amp;lt;code&amp;gt;MultiChoice(Option, 3) → 'Orange'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Multichoice with multiple options selected returns the values of those options as a list, indexed by the variable containing the Multichoice:&lt;br /&gt;
:&amp;lt;code&amp;gt;MultiChoice(Option, 1, 3) → ['Apple', 'Orange']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Multichoice with no options selected returns the first item by default:&lt;br /&gt;
:&amp;lt;code&amp;gt;MultiChoice(Option) → &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unless you specify optional parameter «allowNone» as True, in which case it lets the user choose no option, and returns an empty list indexed by the variable containing the Multichoice:&lt;br /&gt;
:&amp;lt;code&amp;gt;MultiChoice(Option, allowNone: True) → []&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the options come from the variable or index's own [[Domain]]. Two items are selected.&lt;br /&gt;
:&amp;lt;code&amp;gt;MultiChoice(Self, 7,12)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example uses separators, specified as '--', to group the options. Currently &amp;lt;code&amp;gt;'cherry'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'egg plant'&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;'peanut'&amp;lt;/code&amp;gt; are selected.&lt;br /&gt;
:Index Produce_item := &amp;lt;code&amp;gt;['apple', 'banana', 'cherry', '--', 'egg plant', 'lettuce', 'squash', '--', 'almond', 'peanut', 'walnut']&amp;lt;/code&amp;gt;&lt;br /&gt;
:Domain of Produce := {Copy from index} &amp;lt;code&amp;gt;Produce_item&amp;lt;/code&amp;gt;&lt;br /&gt;
:Index Produce := &amp;lt;code&amp;gt;[[MultiChoice]]( Self, 3, 5, 10, separator:'--' )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::[[image:MultiChoice popup.png]]&lt;br /&gt;
&lt;br /&gt;
== Using the MultiChoice control ==&lt;br /&gt;
&lt;br /&gt;
Usually, if you define a variable or index to be a [[MultiChoice]], you will create an input node for that variable. The input node then displays the control on your diagram. The control looks pretty much the same as a [[Choice]] control. When a single item is selected, the selected item appears in the control. When multiple items are selected, the control displays '''«Multiple»''' or '''«All»''', and if no items are selected, it displays '''«None»'''. &lt;br /&gt;
&lt;br /&gt;
When you click on the control, the list of options pops up. Keyboard actions include:&lt;br /&gt;
* [ESC] key: Cancels the current input and closes the popup, restoring the original selection.&lt;br /&gt;
* [Enter] key: Closes the popup, accepting the current selections.&lt;br /&gt;
* [Up] and [Down] arrows: Moves the highlighted selection (no impact on which items are selected).&lt;br /&gt;
* [Space] key: Toggles the highlighted selection. Leaves popup open.&lt;br /&gt;
* [Ctrl+A]: Selects all, or if all options are already selected, deselects all (but leaves one selected if «allowNone» is not on).&lt;br /&gt;
Mouse actions include:&lt;br /&gt;
* Click on item: Toggles item. Leaves popup open.&lt;br /&gt;
* Click outside the control: Accepts selections and closes popup.&lt;br /&gt;
* Click - drag - release: Select or deselect several items. The item where the mouse down occurs determines whether the drag selects or deselects.&lt;br /&gt;
 &lt;br /&gt;
When «allowNone» is not on, the actions that toggle the selection state will not deselect the last selected item.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
==== Handles ====&lt;br /&gt;
When the options are [[handles]] to variables (or other objects), it shows the [[Title]] or [[Identifier]] of each object in the menu (as with [[Choice]]) and returns the [[handle]], not the value of the variable. &lt;br /&gt;
&lt;br /&gt;
==== Pictures in MultiChoice ====&lt;br /&gt;
You can use pictures as MultiChoice options by using an Index with pictures in it. For more information on how to do this, see [https://docs.analytica.com/index.php/Choice#Pictures_in_Choice_nodes Pictures in Choice nodes].&lt;br /&gt;
&lt;br /&gt;
==== Filtering long MultiChoice lists (ACP) ====&lt;br /&gt;
In ACP, when you open a MultiChoice menu that has more than 10 options, it adds a filter box at the top of the menu. As you type into the box, it shortens the menu showing only options that match what you have typed, like so:&lt;br /&gt;
&lt;br /&gt;
[[image:choicefilter.png|link=Special:FilePath/Choicefilter.png|alt=|frameless|314x314px]]&lt;br /&gt;
&lt;br /&gt;
Note that this feature is only available in ACP, not (yet) in Desktop Analytica.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Choice]]&lt;br /&gt;
* [[Choice menu user input]]&lt;br /&gt;
* [[Choice menus and Checkboxes in an edit table]]&lt;br /&gt;
* [http://lumina.com/blog/analytica-5-video-shorts-multichoice-controls Analytica 5 Video Short: MultiChoice controls] on blog (or watch on [https://youtu.be/g9xpsW0cH4o YouTube])&lt;br /&gt;
* [[Checkbox]]&lt;br /&gt;
* [[Preferences]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Choice&amp;diff=62210</id>
		<title>Choice</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Choice&amp;diff=62210"/>
		<updated>2025-02-05T21:41:00Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Filtering long Choice lists (ACP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;  [[Category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[Category: Menus]]&lt;br /&gt;
[[Category:User-interface functions]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
== Choice(i, n) ==&lt;br /&gt;
[[Choice]] is a user-interface function that displays a drop-down menu in the normal view of the Definition (or in a [[User Input nodes|User input]] for the variable) to allow an end user to select from a list of options. The index «i» is the list of options -- an index containing the values appearing on the popup.  When &amp;lt;code&amp;gt;I: Self&amp;lt;/code&amp;gt;, the values listed in the variable's domain are used.  «N» is the position of the currently selected option in that list, or 0 for ''All''.  This should always be an explicit integer, not an expression.&lt;br /&gt;
&lt;br /&gt;
[[Choice]] lets the user to select only one option at a time (or, optionally, All options.) If you want to be able to select any subset of options, use [[MultiChoice]]. A [[Slider]] is another UI control for selecting a single value at a time.&lt;br /&gt;
&lt;br /&gt;
When the user selects a different option, it changes the value of parameter «n» in the Definition to match that option (or 0 to mean ''All'' options.) You can use Choice to show a menu as the definition of a variable or in a cell of an Edit table (or [[ProbTable]] or [[DetermTable]]). [[Choice]] must be the top level of the definition or the cell, and may not be nested within an expression. You must create an Input node for the variable before it will display choices as menus. &lt;br /&gt;
&lt;br /&gt;
The full declaration of Choice() is:&lt;br /&gt;
:[[Choice]](I: Index; n: atomic nonNegative; inclAll: optional boolean = True; Eval: optional boolean = True; Result: optional Array[I], separator: optional text)&lt;br /&gt;
&lt;br /&gt;
==Optional parameters==&lt;br /&gt;
===InclAll===&lt;br /&gt;
«inclAll»  (default &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;) specifies whether the &amp;quot;All&amp;quot; option is displayed. &lt;br /&gt;
&lt;br /&gt;
By default, the menu shows ''All'' as the first option. If you choose ''All'', the result will be computed for every value of index «i». This makes it easy to do a parametric analysis to see how the choices affect the results.  When you choose ''All'', it sets parameter «n» to 0.&lt;br /&gt;
&lt;br /&gt;
If you select ''All'' for multiple Choice menus, each variable influenced by the Choice variables is computed for all combinations of values from those menus,  adding an index dimension to each result. So if there are more than two or three, the number of dimensions may make the result hard to understand, and long to compute. In rare cases, the model may not be able to compute correctly with ''All''. In such cases, you can turn off ''All'' as an option by setting an optional third parameter, «inclAll» to &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt; (0). It usually advisable to set «inclAll» to &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt; whenever you use [[Choice]] in an Edit table.&lt;br /&gt;
&lt;br /&gt;
===Eval===&lt;br /&gt;
The «Eval» parameter specifies whether [[handle]] or expression terms are evaluated for the return value when index i contains handles to variable or expression. It has no effect when the «Result» parameter is specified, or when «I» contains only constants, such as numbers and text strings.  Setting «Eval» to false is recommended in most cases when «I» contains [[handle]]s (variable identifiers). The «Eval» parameter has no effect when «I» is Self (it is always treated as false).&lt;br /&gt;
&lt;br /&gt;
===Result===&lt;br /&gt;
Normally, Choice(I, n) returns the «n»th value of index «I»..  You can use the optional parameter, «Result», to specify a different value to return. The «Result» parameter should be indexed by «I». It will return «Result»[@I = «n»]. &lt;br /&gt;
&lt;br /&gt;
This example returns the index position (instead of the label) of the selected value:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(I, 1, Result: @I)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Suppose you have a table &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and you want your user to select a row of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and then select out only the selected row.  A standard formulation of this is:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Table(I)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision selectedRow := Choice(I, 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable selectedA := A[I = selectedRow]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do this more concisely using the «Result» parameter:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Table(I)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision selectedA := Choice(I, 1, Result: A)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the «Result» parameter is specified, the «Eval» parameter does nothing.&lt;br /&gt;
&lt;br /&gt;
=== Separator===&lt;br /&gt;
You can specify that certain items in &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; are to display as separators -- nonselectable items used to group selectable items in the menu.  Use the «separator» parameter to specify what value in «I» should display as a separator, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(I, 1, separator:'---')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Country_S := ['Canada', 'Mexico', 'USA', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'England', 'France', 'Germany', 'Russia', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'China', 'India', 'Japan','Philippines', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'Australia', 'New Zealand', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'Argentina', 'Brazil', 'Chile']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Select_country := Choice(Country_S, 1, separator:'---')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[image:choice_with_separators.png]]&lt;br /&gt;
&lt;br /&gt;
=== labels and selectionLabels ===&lt;br /&gt;
'''New to [[Analytica 6.4]]''&lt;br /&gt;
&lt;br /&gt;
These optional parameters enable you to display values in the popup menu or in the control that are different from the index values in «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;». Without these, the index values appear.  When used, these should be indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. In the case of a Self-choice, you may need to supply a list of values, which has the disadvantage that it cannot adapt to changes in length or re-orderings of the domain value.   You can also supply images for either -- if you do so, keep them small. They are not resized from the original size.&lt;br /&gt;
&lt;br /&gt;
«labels» contains the values that appear on the popup menu.  When «selectionLabels» isn't also specified, these are also used for the selected value in the control itself.&lt;br /&gt;
&lt;br /&gt;
«selectionLabels» contains the values that appear as the selected value in the control itself.&lt;br /&gt;
&lt;br /&gt;
'''Example 1: City selection'''  &lt;br /&gt;
&lt;br /&gt;
This example of selecting a city from a hierarchical menu provides an example where it is convenient to have different values for the index value (the result), the «labels» and the «selectionLabels». A given city name often appears in multiple states, for example Salem, Oregon and Salem, New York. To keep index elements unique, the values in the index have the full name in the form &amp;lt;code&amp;gt;&amp;quot;Oregon, Salem&amp;quot;&amp;lt;/code&amp;gt;, etc.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index City := [&amp;quot;Alabama, Auburn&amp;quot;, &amp;quot;Alabama, Florence&amp;quot;, &amp;quot;Alabama, Marion&amp;quot;, ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable State_name := [[FindInText]](&amp;quot;^(.+),&amp;quot;,City,subpattern:1,return:'S')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable City_name := [[FindInText]](&amp;quot;,\s*(.+)\s*$&amp;quot;,City,subpattern:1,return:'S')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State_name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;City_name&amp;lt;/code&amp;gt; are indexed by &amp;lt;code&amp;gt;City&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Our city selection can now present only the city name on the menus, but the full name in the selection (and result):&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Choose_city := [[Choice]]( City, 8, inclAll:False, labels:City_name, selectionLabels:City, nestUnder: State_name )&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;amp;rarr;&lt;br /&gt;
:[[image:city select hierarchy.png]]&lt;br /&gt;
&lt;br /&gt;
'''Example 2: Color picker'''&lt;br /&gt;
A second example where it is useful for the labels to be different from the index values is a color picker. The &amp;lt;code&amp;gt;Color&amp;lt;/code&amp;gt; index can contain the color names or RGB integers, whereas the choice contains color swatches (images).&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Color := ['red','white','blue','orange','green']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Color_swatch := [[CanvasImage]]( [[Canvas]]( 10, 25, Color ]] )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Choose_color := [[Choice]]( Color, 1, labels:Color_swatch)&amp;lt;/code&amp;gt; &amp;amp;rarr;&lt;br /&gt;
::[[image:Color_picker_choice.png]]&lt;br /&gt;
&lt;br /&gt;
The result of &amp;lt;code&amp;gt;Choose_color&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;&amp;quot;Green&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== nestUnder for hierarchical menus ===&lt;br /&gt;
''New to [[Analytica 6.4]]''&lt;br /&gt;
&lt;br /&gt;
This optional parameter lets you organize the options into hierarchical submenus. The parameter should be a 1-D array indexed by «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;». The entries must all be text or Null.  Text entries contain the name of the submenu. Multiple levels of submenus are separated by '&amp;gt;'.  For example, consider a &amp;lt;code&amp;gt;City&amp;lt;/code&amp;gt; index with this «nestUnder» array:&lt;br /&gt;
&lt;br /&gt;
::Variable City_submenus &amp;amp;rarr; [[image:City_submenus.png]]&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;code&amp;gt;[[Choice]]( City, 1, nestUnder: City_submenus )&amp;lt;/code&amp;gt; produces this multilevel pulldown:&lt;br /&gt;
&lt;br /&gt;
::[[Image:nestUnderEx.png]]&lt;br /&gt;
&lt;br /&gt;
In this example, Arizona and Nevada are only one level deep, each with a single element, while San Jose is two levels deep, with counties, and cities within each county.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Suppose multiple variables use [[Choice]](I, n) with the same index &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and you choose ''All'' for each of them, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['Low', 'Mid', 'High']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Result := IF A = 'Low' AND B = 'Low' THEN 0 ELSE 100 &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Array(I, [0, 100, 100])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt; is indexed by I only once, and A and B are treated as if they have the same values. If you wanted to vary them independently, they should use different indexes, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['Low', 'Mid', 'High']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Index J := CopyIndex(I)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Choice(J, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Result := IF A = 'Low' AND B = 'Low' THEN 0 ELSE 100 &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Array(I, J, [0, 100, 100], [100, 100, 100], [100, 100, 100])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function [[CopyIndex]](I) makes returns a new index with the same values as &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==Details and more examples==&lt;br /&gt;
=== Self-Indexed Choices ===&lt;br /&gt;
When a variable is defined with the first parameter set to [[Self]], as in the definition:&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then the set of values appearing in the choice are located in the variable's own domain attribute.  In this case, the domain must be either a list, list-of-labels or index type.&lt;br /&gt;
&lt;br /&gt;
The easiest way to create a Self-Choice is to select &amp;quot;Choice...&amp;quot; from the definition type popup.  Analytica will then fill in a default one-element list-of-labels selection. &lt;br /&gt;
&lt;br /&gt;
When a domain is a list, the elements are usually numbers, but may also be variable identifiers or expressions.  (See &amp;quot;Identifier and Expression items&amp;quot; below).&lt;br /&gt;
&lt;br /&gt;
If you use an Index domain, then the values for domain of [[Self]] come from another index variable.  In this case, &amp;lt;code&amp;gt;Choice(Self,1)&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;domain = I&amp;lt;/code&amp;gt; is very similar to &amp;lt;code&amp;gt;Choice(I,1)&amp;lt;/code&amp;gt; with no domain set.  There are, however, several differences. &lt;br /&gt;
&lt;br /&gt;
First, if you use an index domain, then your variable will have both an index value and mid/prob values, while if you use &amp;lt;code&amp;gt;Choice(I, 1)&amp;lt;/code&amp;gt; your variable will not have an index semantics.  &lt;br /&gt;
&lt;br /&gt;
Second, if &amp;quot;All&amp;quot; is selected in the pulldown, the result of &amp;lt;ode&amp;gt;Choice(I, 0) is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;Choice(Self, 0)&amp;lt;/code&amp;gt; is indexed by [[Self]].  &lt;br /&gt;
&lt;br /&gt;
Third, in an index domain using Index I, the values in the domain are the evaluated values of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  If &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; contains only numbers and text strings, then these are the same as the values of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, but if &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; contains identifiers or expressions, then there is a difference.  &amp;lt;code&amp;gt;Choice(I, 1)&amp;lt;/code&amp;gt; would show the identifiers or expressions, while &amp;lt;code&amp;gt;Choice(Self, 1)&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;domain = I&amp;lt;/code&amp;gt; would show the values of those variables in the pulldown.&lt;br /&gt;
&lt;br /&gt;
=== Input Nodes ===&lt;br /&gt;
Selecting &amp;quot;Make Input&amp;quot; from the Object menu creates a pull-down control that you can position on your diagram as part of a user-interface form.&lt;br /&gt;
&lt;br /&gt;
=== Pull-downs in edit tables ===&lt;br /&gt;
You can put a  [[Choice]]  pulldown menu in a cell of an edit table. Just type the expression, such as &amp;lt;code&amp;gt;Choice(option, 1, 0)&amp;lt;/code&amp;gt;. where &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; is an index containing the possible options. You usually set the third parameter, «inclAll», to 0, so to remove the ''All'' option. Otherwise, if the user selects &amp;quot;All&amp;quot; in a table, array abstraction causes the index  &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; to become an index of the entire value of the table result.  Similarly, you can specify [[Choice]] and [[Checkbox]] in the cells of any [[DetermTable]], [[ProbTable]], [[IntraTable]], or  [[SubTable]]. &lt;br /&gt;
&lt;br /&gt;
When you enter a valid [[Choice]] or [[Checkbox]] expression into a table cell, the cell immediately shows the menu or checkbox.  But, you will also see an expression/choice selector near the right top of the window:&lt;br /&gt;
&lt;br /&gt;
:[[image:expr-choice-selector.png]]&lt;br /&gt;
&lt;br /&gt;
If you select the ''expr'' option, you will see all cells as text expressions, so you can review and edit them directly.  &lt;br /&gt;
&lt;br /&gt;
In browse mode, these cells with controls always appear as controls.  The controls appear as disabled (so you can't change them) in browse mode, unless or until you create an input node for the table.&lt;br /&gt;
&lt;br /&gt;
==== In Analytica 4.0 thru Analytica 4.4 ====&lt;br /&gt;
&lt;br /&gt;
In these earlier versions, there is now expression/choice select, and you can only see the   expression in Edit mode, allowing you to edit the definition.&lt;br /&gt;
&lt;br /&gt;
=== Using Choice with DetermTable ===&lt;br /&gt;
A useful arrangement is to use [[Choice]] variables for key parameters, especially parameters where you may want to perform a parametric analysis (by selecting &amp;quot;All&amp;quot;), and then organizing tabular data in [[DetermTable]]s (rather than standard Edit Tables).  This arrangement looks like the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision Scenario := Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Domain of Scenario : [1, 2, 3, 4]&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := DetermTable(Scenario)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this arrangement, the definition of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; appears as an edit table, indexed by all domain values of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  However, when evaluated, only the selected row is returned.&lt;br /&gt;
&lt;br /&gt;
With this arrangement, you can compute downstream results for a single &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; (or other dimension), or for every scenario when &amp;quot;All&amp;quot; is selected.  When available memory limits your ability to perform a full parameter analysis across many dimensions (since the number of combinations increases multiplicatively), this setup makes it easy to limit the parametric analysis to only selected dimensions.&lt;br /&gt;
&lt;br /&gt;
A second variation on this is:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index AllScenarios := [1, 2, 3, 4]&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision Scenario := Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Domain of Scenario : Index AllScenarios&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := DetermTable(Scenario)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Identifier and Expression Items ===&lt;br /&gt;
When an option in «I» is a [[handle]] to a variable, then the pulldown will display either the title of the object or its identifier, depending on whether &amp;quot;Show By Identifier&amp;quot; is selected.  The &amp;quot;Show By Identifier&amp;quot; setting is found on the '''Object''' menu and can also be toggled by pressing ''Ctrl+Y'' .&lt;br /&gt;
&lt;br /&gt;
When you want to set up an explicit list of identifiers to select between, the best way to do this is to create an index node and turn on its [[MetaOnly]] attribute. Then set the definition to be a list and enter the identifiers in each cell. You can also compute a list of identifiers.&lt;br /&gt;
&lt;br /&gt;
When the selected item is a [[handle]] to a variable, the result of evaluating the [[Choice]] function will be either the handle or the result of evaluating the handle, as follows. If the «eval» parameter is specified and set to false, or if the «I» option is [[Self]], then the result is the handle. If the «eval» parameter is specified and true, and the «I» parameter is an index (i.e., not [[Self]]), then the result is the result of evaluating the selected variable. When «eval» is not specified, then a handle is returned if «I» is index node with the [[MetaOnly]] attribute set or if «I» species the domain of another variable, or otherwise the result of evaluating the variable is returned.&lt;br /&gt;
&lt;br /&gt;
If you are dealing with Choices involving variable identifiers, using &amp;lt;code&amp;gt;Eval: False&amp;lt;/code&amp;gt; is generally preferred.  Operations such as comparing the selected value to the original index, or use of a [[DetermTable]] based on the choice variable, function more consistently and less ambiguously.  As a comparison, if you return values (e.g., &amp;lt;code&amp;gt;Eval: True&amp;lt;/code&amp;gt;), and two variables in the choice happen to have the same value, then an ambiguity over which variable was selected exists, but with &amp;lt;code&amp;gt;Eval: False&amp;lt;/code&amp;gt; no such ambiguity exists.&lt;br /&gt;
&lt;br /&gt;
=== Pictures in Choice nodes ===&lt;br /&gt;
You can make Choice nodes with pictures as options by creating an Index with pictures in it and using that as the Index in the Choice function:&lt;br /&gt;
[[image:choiceimages.png|alt=|frameless|369x369px]]&lt;br /&gt;
&lt;br /&gt;
''' Instructions for creating an Index with pictures'''&lt;br /&gt;
# Add each picture into Analytica. For help with this step, see [https://docs.analytica.com/index.php/Graphics,_frames,_and_text_in_a_diagram#Adding_graphics Adding Graphics].&lt;br /&gt;
# Get the identifier of each picture. You can find the identifier of a picture by clicking on the picture node and either looking at the identifier in the Attribute panel or by opening object mode. It will generally start with “Pi” and end with numbers, e.g., Pi123456789.&lt;br /&gt;
# Create a list of handles called ImageHandles using these picture identifiers. Both [[MetaOnly]] index or [https://docs.analytica.com/index.php/Handle_Functions#ListOfHandles.28x1.2C_x2.2C...2Cxn.29 ListofHandles] will work.&lt;br /&gt;
# &amp;lt;code&amp;gt;Pict of (ImageHandles)&amp;lt;/code&amp;gt; will give you an array with the pictures as the values.&lt;br /&gt;
# Use CopyIndex to turn the array indexed by the ListofHandles into an Index&lt;br /&gt;
 &lt;br /&gt;
''' Example code '''&lt;br /&gt;
&lt;br /&gt;
The following code is an example of an Index with pictures when you have a list of identifiers PictureIdentifier1, PictureIdentifier2, etc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CopyIndex(Pict of ListofHandles(PictureIdentifier1, PictureIdentifier2, PictureIdentifier3))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code is an example of an Index with all of the pictures in MyModuleWithPics:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CopyIndex(Pict of #FindObjects(class:Picture, within:Handle(MyModuleWithPics))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can combine picture and text in the same index when they are different slices of the array, e.g., [Picture, Text, Picture, Text], but you cannot combine pictures and text in the same slice of the Index, e.g., [Picture &amp;amp; Text, Picture &amp;amp; Text].&lt;br /&gt;
&lt;br /&gt;
Once you have your list of images, you can use it in a Choice node to get a Choice with images, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Choice(IndexwithPictures, 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Filtering long Choice lists (ACP) ===&lt;br /&gt;
In ACP, when you select a Choice menu that has more than 10 options, it shows a filter box at the top of the menu.  As you type into the box, it shortens the menu showing only options that match what you have typed, like so:&lt;br /&gt;
&lt;br /&gt;
[[image:choicefilter.png|link=Special:FilePath/Choicefilter.png|alt=|frameless|314x314px]]&lt;br /&gt;
&lt;br /&gt;
Note that this feature is only available in ACP, not (yet) in Desktop Analytica.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
Releases prior to Analytica 4.4.2 do not support extremely long option lists on the [[Choice]] popup.  In those releases, the choice pulldown displays only the first 254 items, plus the selected item.  This limitation is fixed in patch release 4.4.2, where no such limitation exists.  If you have many options and for some reason cannot upgrade to 4.4.2 or later, consider creating a 2-stage hierarchical menu, where the first pulldown offers subgroups, and the second shows a the items in that subgroup.&lt;br /&gt;
&lt;br /&gt;
Pulldowns in [[Analytica 4.5]] and later are described [[#In Analytica 4.5 or later|above]].&lt;br /&gt;
&lt;br /&gt;
[[Analytica 6.4]] added an option to add a hierarchical organization to the items by specifying an optional «nestUnder» parameter.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Choice menu user input]]&lt;br /&gt;
* [[Choice menus and Checkboxes in an edit table]]&lt;br /&gt;
* [[MultiChoice]]&lt;br /&gt;
* [[Checkbox]]&lt;br /&gt;
* [[Slider]]&lt;br /&gt;
* [[AskMsgChoice]]&lt;br /&gt;
* [[MetaOnly]]&lt;br /&gt;
* Webinar on [[Analytica_User_Group/Past_Topics#Creating_Control_Panels|Creating Control Panels]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61861</id>
		<title>Array-reducing functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61861"/>
		<updated>2024-11-23T19:52:38Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Text values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Array-reducing functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Array functions &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An '''array-reducing function''' aggregates across an Index (dimension) of an array and returns a result without that Index. So it reduces the number of dimensions of that array by one (or more). Examples include, [[Sum]](x, i), [[Product]](x, i), [[Max]](x, i), [[Min]](x, i), and others described below. The [[Subscript and slice of a subarray |subscript]] construct [[Subscript-Slice_Operator|x[i = v]]] and related slice functions also reduce arrays by a dimension.&lt;br /&gt;
&lt;br /&gt;
The function [[Sum]](x, i) illustrates some properties of reducing functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 59K&lt;br /&gt;
| 62K&lt;br /&gt;
| 66K&lt;br /&gt;
| 71K&lt;br /&gt;
| 76K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Car_prices, Years), Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years, Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;The second parameter, «i», specifying the dimension over which to sum, is optional. But if the array, «x», has more than one dimension, Analytica might not sum over the dimension you expect. For this reason, it is safer always to specify the dimension index explicitly in [[Sum]]() or any other array-reducing function.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Key features==&lt;br /&gt;
&lt;br /&gt;
===Reduce over multiple indexes===&lt;br /&gt;
Most array-reducing functions, including [[Sum]], [[Product]], [[Average]], [[Min]], [[Max]], [[ArgMin]], and [[ArgMax]], let you specify more than one index. This is a convenient way to operate over multiple indexes in a single call, for example:&lt;br /&gt;
&lt;br /&gt;
:Sum(x, i, j, k)&lt;br /&gt;
&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
:Sum(Sum(Sum(x, i), j), k)&lt;br /&gt;
&lt;br /&gt;
===Reduce over all indexes===&lt;br /&gt;
You can sum over ''all'' the indexes of an array without having to list them explicitly:&lt;br /&gt;
:Sum(x, ... IndexesOf(x))&lt;br /&gt;
This necessarily returns a scalar -- i.e. value with no index. See [[Repeated Parameter Forwarding]] for details.&lt;br /&gt;
&lt;br /&gt;
Below we describe the most common array-reducing functions.&lt;br /&gt;
&lt;br /&gt;
===Reducing over an unused index===&lt;br /&gt;
&lt;br /&gt;
If the index, «i», is not a dimension of «x», [[Sum]](x, i) returns «x» unreduced (i.e., with the same number of indexes), but multiplied by the size (number of elements) of «i». The reason is that if «x» is not indexed by «i», it means that it has the same value for all values of «i». This is true even if «x» is an atom with no dimensions:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable x := 5&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(x, Car_type) &amp;amp;rarr; 15&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; has three elements (3 x 5 = 15). &lt;br /&gt;
&lt;br /&gt;
In this way, if we later decide to change the value for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; for each value of &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;, we can redefine «x» as an edit table indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;. Any expression containing a [[Sum]]() or other reducing function on «x» works correctly whether it is indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; or not.&lt;br /&gt;
&lt;br /&gt;
===Ignoring Null===&lt;br /&gt;
&lt;br /&gt;
These array-reducing functions ignore elements of an array that contain [[Null]]. For example, the [[Average]](x, i) function sums all the non-null elements of «x» and divides by the number of non-null elements. This feature is very convenient when working with missing data.&lt;br /&gt;
&lt;br /&gt;
===Treatment of NAN===&lt;br /&gt;
&lt;br /&gt;
When the array contains a '''NaN''' value (an indeterminate number), the result of a function on the array is usually '''NaN''' as well. '''NaN''' values result from indeterminate operations such as &amp;lt;code&amp;gt;0/0&amp;lt;/code&amp;gt;. NaNs propagate in this fashion to ensure that you will not accidentally compute an indeterminate result without realizing it. However, if you wish to ignore '''NaN''' values, the functions [[Sum]], [[Product]], [[Average]], [[Min]], and [[Max]] all accept an optional parameter, «ignoreNaN» that can be set to True. «IgnoreNan» requires a named-parameter syntax, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNaN: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text values===&lt;br /&gt;
&lt;br /&gt;
When the parameter contains both text and numbers, [[Sum]], [[Min]] and [[Max]]  normally return NaN. But you can instruct them to ignore non-numeric values (except NaN) using the optional «ignoreNonNumbers» parameter, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNonNumbers: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functions [[Min]], [[Max]], [[ArgMin]], [[ArgMax]], [[CondMin]] and [[CondMax]] work on text values using alphabetical ordering. Min refers to the first item and Max the last item alphabetically.&lt;br /&gt;
&lt;br /&gt;
==Sum(x, ''i'')==&lt;br /&gt;
Returns the sum of array «x» over the dimension indexed by «i».&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Product(x,''i'')==&lt;br /&gt;
Returns the product of all of the elements of «x», along the dimension indexed by «i». See also [[Product]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Product(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 7.2T&lt;br /&gt;
| 8.398T&lt;br /&gt;
| 10.08Y&lt;br /&gt;
| 12.54T&lt;br /&gt;
| 15.36T&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Average(x, ''i'')==&lt;br /&gt;
Returns the mean value of all of the elements of array «x», averaged over index «i». See also [[Average]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Average(Miles, Years)&amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 8000&lt;br /&gt;
| 12K&lt;br /&gt;
| 7600&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Max(x, i)==&lt;br /&gt;
Returns the highest valued element of «x» along index «i». See also [[Max]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 10K&lt;br /&gt;
| 12K&lt;br /&gt;
| 10K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the maximum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max([10, 5]) &amp;amp;rarr; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Min(x, ''i'')==&lt;br /&gt;
Returns the lowest valued element of «x» along index «i». See also [[Min]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 6000&lt;br /&gt;
| 10K&lt;br /&gt;
| 5000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the minimum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min([10, 5]) &amp;amp;rarr; 5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ArgMax(a, i) and ArgMin(a, i)==&lt;br /&gt;
ArgMax(a, i) an item of index «i» for which array «a» is the maximum. Similarly, ArgMin(a, i) returns a value of  «i» for which «a»  is minimum.  &lt;br /&gt;
&lt;br /&gt;
'''Position''': If you specify optional parameter &amp;lt;code&amp;gt;First: True&amp;lt;/code&amp;gt;, these functions return the position (integer number) isntead of the value of «i» of the maximum (or minimum) value in «a».&lt;br /&gt;
&lt;br /&gt;
'''First''': If «a» has more than one maximum (minimum) value, it normally returns the last one.  Or you can specify optional parameter &amp;lt;code&amp;gt;First: False&amp;lt;/code&amp;gt; if you prefer to return the first one.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMax(Miles, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMin(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;text-align: left;&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| VW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CondMin(x, cond, i) and CondMax(x, cond, i)==&lt;br /&gt;
&lt;br /&gt;
[[CondMin]]() &amp;quot;conditional min&amp;quot; returns the smallest value along a given index, «i», that satisfies condition «cond».&lt;br /&gt;
Similarly, [[CondMax]]() returns the largest  When «cond» is never satisfied, [[CondMin]]() returns [[INF]] and [[CondMax]]() returns &amp;lt;code&amp;gt;-INF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' none&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;CondMin(Cost_of_ownership, Time &amp;gt;= 2, Time) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 3098&lt;br /&gt;
| 3897&lt;br /&gt;
| 3409&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==SubIndex(a, u, i)==&lt;br /&gt;
&lt;br /&gt;
Does a lookup (similar to VLookup and Hlookup in Excel) returning the value of  index «i» of array «a» for which «a» equals «u» -- in other words, it returns the value &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; of index «i» for which array «a»[«i» = &amp;lt;code&amp;gt;vi] =&amp;lt;/code&amp;gt; «u». If «a» contains multiple values equal to «u», it returns the last value of «i» that matches. If no value of «a» equals «u», it returns [[Null]]. If «a» has index(es) in addition to «i», or if «u» is an array with other indexes, those indexes also appear in the result. See also [[SubIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 2007&lt;br /&gt;
| 2005&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If «u» is an array of values, it returns an array with the same indexes.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, [18K, 19K] Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
!Subindex &amp;amp;#9660;&lt;br /&gt;
!2005&lt;br /&gt;
!2006&lt;br /&gt;
!2007&lt;br /&gt;
!2008&lt;br /&gt;
!2009&lt;br /&gt;
|-&lt;br /&gt;
|'''18K'''&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|«null»&lt;br /&gt;
|-&lt;br /&gt;
|'''19K'''&lt;br /&gt;
|«null»&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PositionInIndex(a, x, i)==&lt;br /&gt;
Returns the position &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; in index «i» for which x[@i = &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;] = x — that is, a number from 1 to the size of index «i» — of the last element of array «a» equal to «x». If no element of «a» matches  «x», it returns 0.  See also [[PositionInIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['A', 'B', 'C']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Array(I, [1, 2, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 1, I) &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 2, I) &amp;amp;rarr; 3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 5, I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;[[PositionInIndex]]() is the positional equivalent of [[Subindex]](). It is useful when «i» contains duplicate values, in which case [[Subindex]]() would return an ambiguous result.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;Parameter a is optional. When omitted, it returns the position of x in the index i, or 0 if not found. The syntax &amp;lt;code&amp;gt;@[i = x]&amp;lt;/code&amp;gt; (see [[Subscript and slice of a subarray#@: Index Position Operator|@: Index Position Operator]]) returns the same result as &amp;lt;code&amp;gt;PositionInIndex(, x, i)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'B', I) &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'B'] &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'D', I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'D'] &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the array is multidimensional:&lt;br /&gt;
Taking the same example from above:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Area(y, x, ''x1, x2, i'')==&lt;br /&gt;
Returns the area (sum of trapezoids) under the piecewise-linear curve denoted by the points&lt;br /&gt;
(«x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;», «y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;»), landing in the region «x1» &amp;amp;le; «x» &amp;amp;le;  «x2». The arrays «x» and «y» must share the common index «i», or when either «x» or «y» is itself an index, «i» can be safely omitted. «x» and «x2» are optional; if they are not specified, the area is calculated across all values of «x».&lt;br /&gt;
&lt;br /&gt;
If «x1» or «x2» fall outside the range of values in «i», the first value (for «x1») or last value (for «x1») are used. [[Area]]() computes the total integral across «x», returning a value with one less dimension than «y». Compare [[Area]]() to [[Transforming functions#Integrate()|Integrate()]].&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example''' &lt;br /&gt;
:&amp;lt;code&amp;gt;Area(Cost_of_ownership, Time, 0, 2) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 5905&lt;br /&gt;
| 7563&lt;br /&gt;
| 6591&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Tutorial: Arrays#Array_Reducing_Functions|Tutorial: Array Reducing Functions]]&lt;br /&gt;
* [[:Category:Array-reducing functions]]&lt;br /&gt;
* [[Tutorial: Arrays#Reducing_an_array_using_subscripts|Tutorial: Reducing an array using subscripts]]&lt;br /&gt;
* [[Sum]]()&lt;br /&gt;
* [[Product]]()&lt;br /&gt;
* [[Average]]()&lt;br /&gt;
* [[Functions Min and Max]]&lt;br /&gt;
* [[Max]]()&lt;br /&gt;
* [[Min]]()&lt;br /&gt;
* [[ArgMax]]()&lt;br /&gt;
* [[ArgMin]]()&lt;br /&gt;
* [[CondMin]]()&lt;br /&gt;
* [[CondMax]]()&lt;br /&gt;
* [[SubIndex]]()&lt;br /&gt;
* [[PositionInIndex]]()&lt;br /&gt;
* [[Area]]()&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Multidimensional array]]&lt;br /&gt;
* [[Relational tables and multiD arrays]]&lt;br /&gt;
* [[Repeated Parameter Forwarding|Reducing over all indexes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Functions that create arrays / {{PAGENAME}} / Transforming functions&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61860</id>
		<title>Array-reducing functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61860"/>
		<updated>2024-11-23T19:45:22Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Text values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Array-reducing functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Array functions &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An '''array-reducing function''' aggregates across an Index (dimension) of an array and returns a result without that Index. So it reduces the number of dimensions of that array by one (or more). Examples include, [[Sum]](x, i), [[Product]](x, i), [[Max]](x, i), [[Min]](x, i), and others described below. The [[Subscript and slice of a subarray |subscript]] construct [[Subscript-Slice_Operator|x[i = v]]] and related slice functions also reduce arrays by a dimension.&lt;br /&gt;
&lt;br /&gt;
The function [[Sum]](x, i) illustrates some properties of reducing functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 59K&lt;br /&gt;
| 62K&lt;br /&gt;
| 66K&lt;br /&gt;
| 71K&lt;br /&gt;
| 76K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Car_prices, Years), Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years, Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;The second parameter, «i», specifying the dimension over which to sum, is optional. But if the array, «x», has more than one dimension, Analytica might not sum over the dimension you expect. For this reason, it is safer always to specify the dimension index explicitly in [[Sum]]() or any other array-reducing function.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Key features==&lt;br /&gt;
&lt;br /&gt;
===Reduce over multiple indexes===&lt;br /&gt;
Most array-reducing functions, including [[Sum]], [[Product]], [[Average]], [[Min]], [[Max]], [[ArgMin]], and [[ArgMax]], let you specify more than one index. This is a convenient way to operate over multiple indexes in a single call, for example:&lt;br /&gt;
&lt;br /&gt;
:Sum(x, i, j, k)&lt;br /&gt;
&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
:Sum(Sum(Sum(x, i), j), k)&lt;br /&gt;
&lt;br /&gt;
===Reduce over all indexes===&lt;br /&gt;
You can sum over ''all'' the indexes of an array without having to list them explicitly:&lt;br /&gt;
:Sum(x, ... IndexesOf(x))&lt;br /&gt;
This necessarily returns a scalar -- i.e. value with no index. See [[Repeated Parameter Forwarding]] for details.&lt;br /&gt;
&lt;br /&gt;
Below we describe the most common array-reducing functions.&lt;br /&gt;
&lt;br /&gt;
===Reducing over an unused index===&lt;br /&gt;
&lt;br /&gt;
If the index, «i», is not a dimension of «x», [[Sum]](x, i) returns «x» unreduced (i.e., with the same number of indexes), but multiplied by the size (number of elements) of «i». The reason is that if «x» is not indexed by «i», it means that it has the same value for all values of «i». This is true even if «x» is an atom with no dimensions:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable x := 5&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(x, Car_type) &amp;amp;rarr; 15&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; has three elements (3 x 5 = 15). &lt;br /&gt;
&lt;br /&gt;
In this way, if we later decide to change the value for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; for each value of &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;, we can redefine «x» as an edit table indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;. Any expression containing a [[Sum]]() or other reducing function on «x» works correctly whether it is indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; or not.&lt;br /&gt;
&lt;br /&gt;
===Ignoring Null===&lt;br /&gt;
&lt;br /&gt;
These array-reducing functions ignore elements of an array that contain [[Null]]. For example, the [[Average]](x, i) function sums all the non-null elements of «x» and divides by the number of non-null elements. This feature is very convenient when working with missing data.&lt;br /&gt;
&lt;br /&gt;
===Treatment of NAN===&lt;br /&gt;
&lt;br /&gt;
When the array contains a '''NaN''' value (an indeterminate number), the result of a function on the array is usually '''NaN''' as well. '''NaN''' values result from indeterminate operations such as &amp;lt;code&amp;gt;0/0&amp;lt;/code&amp;gt;. NaNs propagate in this fashion to ensure that you will not accidentally compute an indeterminate result without realizing it. However, if you wish to ignore '''NaN''' values, the functions [[Sum]], [[Product]], [[Average]], [[Min]], and [[Max]] all accept an optional parameter, «ignoreNaN» that can be set to True. «IgnoreNan» requires a named-parameter syntax, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNaN: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text values===&lt;br /&gt;
&lt;br /&gt;
When the parameter contains both text and numbers, these functions normally return NaN. But you can instruct [[Sum]], [[Min]] and [[Max]] to ignore non-numeric values (except NaN) using the optional «ignoreNonNumbers» parameter, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNonNumbers: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sum(x, ''i'')==&lt;br /&gt;
Returns the sum of array «x» over the dimension indexed by «i».&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Product(x,''i'')==&lt;br /&gt;
Returns the product of all of the elements of «x», along the dimension indexed by «i». See also [[Product]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Product(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 7.2T&lt;br /&gt;
| 8.398T&lt;br /&gt;
| 10.08Y&lt;br /&gt;
| 12.54T&lt;br /&gt;
| 15.36T&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Average(x, ''i'')==&lt;br /&gt;
Returns the mean value of all of the elements of array «x», averaged over index «i». See also [[Average]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Average(Miles, Years)&amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 8000&lt;br /&gt;
| 12K&lt;br /&gt;
| 7600&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Max(x, i)==&lt;br /&gt;
Returns the highest valued element of «x» along index «i». See also [[Max]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 10K&lt;br /&gt;
| 12K&lt;br /&gt;
| 10K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the maximum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max([10, 5]) &amp;amp;rarr; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Min(x, ''i'')==&lt;br /&gt;
Returns the lowest valued element of «x» along index «i». See also [[Min]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 6000&lt;br /&gt;
| 10K&lt;br /&gt;
| 5000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the minimum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min([10, 5]) &amp;amp;rarr; 5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ArgMax(a, i) and ArgMin(a, i)==&lt;br /&gt;
ArgMax(a, i) an item of index «i» for which array «a» is the maximum. Similarly, ArgMin(a, i) returns a value of  «i» for which «a»  is minimum.  &lt;br /&gt;
&lt;br /&gt;
'''Position''': If you specify optional parameter &amp;lt;code&amp;gt;First: True&amp;lt;/code&amp;gt;, these functions return the position (integer number) isntead of the value of «i» of the maximum (or minimum) value in «a».&lt;br /&gt;
&lt;br /&gt;
'''First''': If «a» has more than one maximum (minimum) value, it normally returns the last one.  Or you can specify optional parameter &amp;lt;code&amp;gt;First: False&amp;lt;/code&amp;gt; if you prefer to return the first one.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMax(Miles, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMin(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;text-align: left;&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| VW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CondMin(x, cond, i) and CondMax(x, cond, i)==&lt;br /&gt;
&lt;br /&gt;
[[CondMin]]() &amp;quot;conditional min&amp;quot; returns the smallest value along a given index, «i», that satisfies condition «cond».&lt;br /&gt;
Similarly, [[CondMax]]() returns the largest  When «cond» is never satisfied, [[CondMin]]() returns [[INF]] and [[CondMax]]() returns &amp;lt;code&amp;gt;-INF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' none&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;CondMin(Cost_of_ownership, Time &amp;gt;= 2, Time) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 3098&lt;br /&gt;
| 3897&lt;br /&gt;
| 3409&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==SubIndex(a, u, i)==&lt;br /&gt;
&lt;br /&gt;
Does a lookup (similar to VLookup and Hlookup in Excel) returning the value of  index «i» of array «a» for which «a» equals «u» -- in other words, it returns the value &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; of index «i» for which array «a»[«i» = &amp;lt;code&amp;gt;vi] =&amp;lt;/code&amp;gt; «u». If «a» contains multiple values equal to «u», it returns the last value of «i» that matches. If no value of «a» equals «u», it returns [[Null]]. If «a» has index(es) in addition to «i», or if «u» is an array with other indexes, those indexes also appear in the result. See also [[SubIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 2007&lt;br /&gt;
| 2005&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If «u» is an array of values, it returns an array with the same indexes.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, [18K, 19K] Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
!Subindex &amp;amp;#9660;&lt;br /&gt;
!2005&lt;br /&gt;
!2006&lt;br /&gt;
!2007&lt;br /&gt;
!2008&lt;br /&gt;
!2009&lt;br /&gt;
|-&lt;br /&gt;
|'''18K'''&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|«null»&lt;br /&gt;
|-&lt;br /&gt;
|'''19K'''&lt;br /&gt;
|«null»&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PositionInIndex(a, x, i)==&lt;br /&gt;
Returns the position &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; in index «i» for which x[@i = &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;] = x — that is, a number from 1 to the size of index «i» — of the last element of array «a» equal to «x». If no element of «a» matches  «x», it returns 0.  See also [[PositionInIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['A', 'B', 'C']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Array(I, [1, 2, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 1, I) &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 2, I) &amp;amp;rarr; 3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 5, I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;[[PositionInIndex]]() is the positional equivalent of [[Subindex]](). It is useful when «i» contains duplicate values, in which case [[Subindex]]() would return an ambiguous result.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;Parameter a is optional. When omitted, it returns the position of x in the index i, or 0 if not found. The syntax &amp;lt;code&amp;gt;@[i = x]&amp;lt;/code&amp;gt; (see [[Subscript and slice of a subarray#@: Index Position Operator|@: Index Position Operator]]) returns the same result as &amp;lt;code&amp;gt;PositionInIndex(, x, i)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'B', I) &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'B'] &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'D', I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'D'] &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the array is multidimensional:&lt;br /&gt;
Taking the same example from above:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Area(y, x, ''x1, x2, i'')==&lt;br /&gt;
Returns the area (sum of trapezoids) under the piecewise-linear curve denoted by the points&lt;br /&gt;
(«x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;», «y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;»), landing in the region «x1» &amp;amp;le; «x» &amp;amp;le;  «x2». The arrays «x» and «y» must share the common index «i», or when either «x» or «y» is itself an index, «i» can be safely omitted. «x» and «x2» are optional; if they are not specified, the area is calculated across all values of «x».&lt;br /&gt;
&lt;br /&gt;
If «x1» or «x2» fall outside the range of values in «i», the first value (for «x1») or last value (for «x1») are used. [[Area]]() computes the total integral across «x», returning a value with one less dimension than «y». Compare [[Area]]() to [[Transforming functions#Integrate()|Integrate()]].&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example''' &lt;br /&gt;
:&amp;lt;code&amp;gt;Area(Cost_of_ownership, Time, 0, 2) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 5905&lt;br /&gt;
| 7563&lt;br /&gt;
| 6591&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Tutorial: Arrays#Array_Reducing_Functions|Tutorial: Array Reducing Functions]]&lt;br /&gt;
* [[:Category:Array-reducing functions]]&lt;br /&gt;
* [[Tutorial: Arrays#Reducing_an_array_using_subscripts|Tutorial: Reducing an array using subscripts]]&lt;br /&gt;
* [[Sum]]()&lt;br /&gt;
* [[Product]]()&lt;br /&gt;
* [[Average]]()&lt;br /&gt;
* [[Functions Min and Max]]&lt;br /&gt;
* [[Max]]()&lt;br /&gt;
* [[Min]]()&lt;br /&gt;
* [[ArgMax]]()&lt;br /&gt;
* [[ArgMin]]()&lt;br /&gt;
* [[CondMin]]()&lt;br /&gt;
* [[CondMax]]()&lt;br /&gt;
* [[SubIndex]]()&lt;br /&gt;
* [[PositionInIndex]]()&lt;br /&gt;
* [[Area]]()&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Multidimensional array]]&lt;br /&gt;
* [[Relational tables and multiD arrays]]&lt;br /&gt;
* [[Repeated Parameter Forwarding|Reducing over all indexes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Functions that create arrays / {{PAGENAME}} / Transforming functions&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61859</id>
		<title>Array-reducing functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61859"/>
		<updated>2024-11-23T19:42:06Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Array-reducing functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Array functions &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An '''array-reducing function''' aggregates across an Index (dimension) of an array and returns a result without that Index. So it reduces the number of dimensions of that array by one (or more). Examples include, [[Sum]](x, i), [[Product]](x, i), [[Max]](x, i), [[Min]](x, i), and others described below. The [[Subscript and slice of a subarray |subscript]] construct [[Subscript-Slice_Operator|x[i = v]]] and related slice functions also reduce arrays by a dimension.&lt;br /&gt;
&lt;br /&gt;
The function [[Sum]](x, i) illustrates some properties of reducing functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 59K&lt;br /&gt;
| 62K&lt;br /&gt;
| 66K&lt;br /&gt;
| 71K&lt;br /&gt;
| 76K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Car_prices, Years), Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or more simply:&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years, Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;The second parameter, «i», specifying the dimension over which to sum, is optional. But if the array, «x», has more than one dimension, Analytica might not sum over the dimension you expect. For this reason, it is safer always to specify the dimension index explicitly in [[Sum]]() or any other array-reducing function.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Key features==&lt;br /&gt;
&lt;br /&gt;
===Reduce over multiple indexes===&lt;br /&gt;
Most array-reducing functions, including [[Sum]], [[Product]], [[Average]], [[Min]], [[Max]], [[ArgMin]], and [[ArgMax]], let you specify more than one index. This is a convenient way to operate over multiple indexes in a single call, for example:&lt;br /&gt;
&lt;br /&gt;
:Sum(x, i, j, k)&lt;br /&gt;
&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
:Sum(Sum(Sum(x, i), j), k)&lt;br /&gt;
&lt;br /&gt;
===Reduce over all indexes===&lt;br /&gt;
You can sum over ''all'' the indexes of an array without having to list them explicitly:&lt;br /&gt;
:Sum(x, ... IndexesOf(x))&lt;br /&gt;
This necessarily returns a scalar -- i.e. value with no index. See [[Repeated Parameter Forwarding]] for details.&lt;br /&gt;
&lt;br /&gt;
Below we describe the most common array-reducing functions.&lt;br /&gt;
&lt;br /&gt;
===Reducing over an unused index===&lt;br /&gt;
&lt;br /&gt;
If the index, «i», is not a dimension of «x», [[Sum]](x, i) returns «x» unreduced (i.e., with the same number of indexes), but multiplied by the size (number of elements) of «i». The reason is that if «x» is not indexed by «i», it means that it has the same value for all values of «i». This is true even if «x» is an atom with no dimensions:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable x := 5&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(x, Car_type) &amp;amp;rarr; 15&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; has three elements (3 x 5 = 15). &lt;br /&gt;
&lt;br /&gt;
In this way, if we later decide to change the value for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; for each value of &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;, we can redefine «x» as an edit table indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;. Any expression containing a [[Sum]]() or other reducing function on «x» works correctly whether it is indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; or not.&lt;br /&gt;
&lt;br /&gt;
===Ignoring Null===&lt;br /&gt;
&lt;br /&gt;
These array-reducing functions ignore elements of an array that contain [[Null]]. For example, the [[Average]](x, i) function sums all the non-null elements of «x» and divides by the number of non-null elements. This feature is very convenient when working with missing data.&lt;br /&gt;
&lt;br /&gt;
===Treatment of NAN===&lt;br /&gt;
&lt;br /&gt;
When the array contains a '''NaN''' value (an indeterminate number), the result of a function on the array is usually '''NaN''' as well. '''NaN''' values result from indeterminate operations such as &amp;lt;code&amp;gt;0/0&amp;lt;/code&amp;gt;. NaNs propagate in this fashion to ensure that you will not accidentally compute an indeterminate result without realizing it. However, if you wish to ignore '''NaN''' values, the functions [[Sum]], [[Product]], [[Average]], [[Min]], and [[Max]] all accept an optional parameter, «ignoreNaN» that can be set to True. «IgnoreNan» requires a named-parameter syntax, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNaN: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text values===&lt;br /&gt;
&lt;br /&gt;
 When the parameter contains both text and numbers, you can instruct [[Sum]], [[Min]] and [[Max]] to ignore the non-numeric values using the optional «ignoreNonNumbers» parameter, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNonNumbers: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sum(x, ''i'')==&lt;br /&gt;
Returns the sum of array «x» over the dimension indexed by «i».&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Product(x,''i'')==&lt;br /&gt;
Returns the product of all of the elements of «x», along the dimension indexed by «i». See also [[Product]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Product(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 7.2T&lt;br /&gt;
| 8.398T&lt;br /&gt;
| 10.08Y&lt;br /&gt;
| 12.54T&lt;br /&gt;
| 15.36T&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Average(x, ''i'')==&lt;br /&gt;
Returns the mean value of all of the elements of array «x», averaged over index «i». See also [[Average]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Average(Miles, Years)&amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 8000&lt;br /&gt;
| 12K&lt;br /&gt;
| 7600&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Max(x, i)==&lt;br /&gt;
Returns the highest valued element of «x» along index «i». See also [[Max]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 10K&lt;br /&gt;
| 12K&lt;br /&gt;
| 10K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the maximum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max([10, 5]) &amp;amp;rarr; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Min(x, ''i'')==&lt;br /&gt;
Returns the lowest valued element of «x» along index «i». See also [[Min]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 6000&lt;br /&gt;
| 10K&lt;br /&gt;
| 5000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the minimum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min([10, 5]) &amp;amp;rarr; 5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ArgMax(a, i) and ArgMin(a, i)==&lt;br /&gt;
ArgMax(a, i) an item of index «i» for which array «a» is the maximum. Similarly, ArgMin(a, i) returns a value of  «i» for which «a»  is minimum.  &lt;br /&gt;
&lt;br /&gt;
'''Position''': If you specify optional parameter &amp;lt;code&amp;gt;First: True&amp;lt;/code&amp;gt;, these functions return the position (integer number) isntead of the value of «i» of the maximum (or minimum) value in «a».&lt;br /&gt;
&lt;br /&gt;
'''First''': If «a» has more than one maximum (minimum) value, it normally returns the last one.  Or you can specify optional parameter &amp;lt;code&amp;gt;First: False&amp;lt;/code&amp;gt; if you prefer to return the first one.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMax(Miles, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMin(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;text-align: left;&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| VW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CondMin(x, cond, i) and CondMax(x, cond, i)==&lt;br /&gt;
&lt;br /&gt;
[[CondMin]]() &amp;quot;conditional min&amp;quot; returns the smallest value along a given index, «i», that satisfies condition «cond».&lt;br /&gt;
Similarly, [[CondMax]]() returns the largest  When «cond» is never satisfied, [[CondMin]]() returns [[INF]] and [[CondMax]]() returns &amp;lt;code&amp;gt;-INF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' none&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;CondMin(Cost_of_ownership, Time &amp;gt;= 2, Time) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 3098&lt;br /&gt;
| 3897&lt;br /&gt;
| 3409&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==SubIndex(a, u, i)==&lt;br /&gt;
&lt;br /&gt;
Does a lookup (similar to VLookup and Hlookup in Excel) returning the value of  index «i» of array «a» for which «a» equals «u» -- in other words, it returns the value &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; of index «i» for which array «a»[«i» = &amp;lt;code&amp;gt;vi] =&amp;lt;/code&amp;gt; «u». If «a» contains multiple values equal to «u», it returns the last value of «i» that matches. If no value of «a» equals «u», it returns [[Null]]. If «a» has index(es) in addition to «i», or if «u» is an array with other indexes, those indexes also appear in the result. See also [[SubIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 2007&lt;br /&gt;
| 2005&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If «u» is an array of values, it returns an array with the same indexes.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, [18K, 19K] Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
!Subindex &amp;amp;#9660;&lt;br /&gt;
!2005&lt;br /&gt;
!2006&lt;br /&gt;
!2007&lt;br /&gt;
!2008&lt;br /&gt;
!2009&lt;br /&gt;
|-&lt;br /&gt;
|'''18K'''&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|«null»&lt;br /&gt;
|-&lt;br /&gt;
|'''19K'''&lt;br /&gt;
|«null»&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PositionInIndex(a, x, i)==&lt;br /&gt;
Returns the position &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; in index «i» for which x[@i = &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;] = x — that is, a number from 1 to the size of index «i» — of the last element of array «a» equal to «x». If no element of «a» matches  «x», it returns 0.  See also [[PositionInIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['A', 'B', 'C']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Array(I, [1, 2, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 1, I) &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 2, I) &amp;amp;rarr; 3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 5, I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;[[PositionInIndex]]() is the positional equivalent of [[Subindex]](). It is useful when «i» contains duplicate values, in which case [[Subindex]]() would return an ambiguous result.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;Parameter a is optional. When omitted, it returns the position of x in the index i, or 0 if not found. The syntax &amp;lt;code&amp;gt;@[i = x]&amp;lt;/code&amp;gt; (see [[Subscript and slice of a subarray#@: Index Position Operator|@: Index Position Operator]]) returns the same result as &amp;lt;code&amp;gt;PositionInIndex(, x, i)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'B', I) &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'B'] &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'D', I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'D'] &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the array is multidimensional:&lt;br /&gt;
Taking the same example from above:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Area(y, x, ''x1, x2, i'')==&lt;br /&gt;
Returns the area (sum of trapezoids) under the piecewise-linear curve denoted by the points&lt;br /&gt;
(«x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;», «y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;»), landing in the region «x1» &amp;amp;le; «x» &amp;amp;le;  «x2». The arrays «x» and «y» must share the common index «i», or when either «x» or «y» is itself an index, «i» can be safely omitted. «x» and «x2» are optional; if they are not specified, the area is calculated across all values of «x».&lt;br /&gt;
&lt;br /&gt;
If «x1» or «x2» fall outside the range of values in «i», the first value (for «x1») or last value (for «x1») are used. [[Area]]() computes the total integral across «x», returning a value with one less dimension than «y». Compare [[Area]]() to [[Transforming functions#Integrate()|Integrate()]].&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example''' &lt;br /&gt;
:&amp;lt;code&amp;gt;Area(Cost_of_ownership, Time, 0, 2) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 5905&lt;br /&gt;
| 7563&lt;br /&gt;
| 6591&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Tutorial: Arrays#Array_Reducing_Functions|Tutorial: Array Reducing Functions]]&lt;br /&gt;
* [[:Category:Array-reducing functions]]&lt;br /&gt;
* [[Tutorial: Arrays#Reducing_an_array_using_subscripts|Tutorial: Reducing an array using subscripts]]&lt;br /&gt;
* [[Sum]]()&lt;br /&gt;
* [[Product]]()&lt;br /&gt;
* [[Average]]()&lt;br /&gt;
* [[Functions Min and Max]]&lt;br /&gt;
* [[Max]]()&lt;br /&gt;
* [[Min]]()&lt;br /&gt;
* [[ArgMax]]()&lt;br /&gt;
* [[ArgMin]]()&lt;br /&gt;
* [[CondMin]]()&lt;br /&gt;
* [[CondMax]]()&lt;br /&gt;
* [[SubIndex]]()&lt;br /&gt;
* [[PositionInIndex]]()&lt;br /&gt;
* [[Area]]()&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Multidimensional array]]&lt;br /&gt;
* [[Relational tables and multiD arrays]]&lt;br /&gt;
* [[Repeated Parameter Forwarding|Reducing over all indexes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Functions that create arrays / {{PAGENAME}} / Transforming functions&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61858</id>
		<title>Array-reducing functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61858"/>
		<updated>2024-11-23T19:20:50Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Array-reducing functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Array functions &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An '''array-reducing function''' aggregates across an Index (dimension) of an array and returns a result without that Index. So reduces the number of dimensions of that array by one (or more). Examples include, [[Sum]](x, i), [[Product]](x, i), [[Max]](x, i), [[Min]](x, i), and others described below. The [[Subscript and slice of a subarray |subscript]] construct [[Subscript-Slice_Operator|x[i = v]]] and related slice functions also reduce arrays by a dimension.&lt;br /&gt;
&lt;br /&gt;
The function [[Sum]](x, i) illustrates some properties of reducing functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 59K&lt;br /&gt;
| 62K&lt;br /&gt;
| 66K&lt;br /&gt;
| 71K&lt;br /&gt;
| 76K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Car_prices, Years), Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;The second parameter, «i», specifying the dimension over which to sum, is optional. But if the array, «x», has more than one dimension, Analytica might not sum over the dimension you expect. For this reason, it is safer always to specify the dimension index explicitly in [[Sum]]() or any other array-reducing function.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reducing over an unused index:''' If the index, «i», is not a dimension of «x», [[Sum]](x, i) returns «x» unreduced (i.e., with the same number of indexes), but multiplied by the size (number of elements) of «i». The reason is that if «x» is not indexed by «i», it means that it has the same value for all values of «i». This is true even if «x» is an atom with no dimensions:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable x := 5&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(x, Car_type) &amp;amp;rarr; 15&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; has three elements (3 x 5 = 15). &lt;br /&gt;
&lt;br /&gt;
In this way, if we later decide to change the value for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; for each value of &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;, we can redefine «x» as an edit table indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;. Any expression containing a [[Sum]]() or other reducing function on «x» works correctly whether it is indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; or not.&lt;br /&gt;
&lt;br /&gt;
'''Elements that are ignored:''' These array-reducing functions ignore elements of an array that contain [[Null]]. For example, the [[Average]](x, i) function sums all the non-null elements of «x» and divides by the number of non-null elements.&lt;br /&gt;
&lt;br /&gt;
'''IgnoreNaN''': When a '''NaN''' value (an indeterminate number) appears as an element of an array, the result of a function that operates on the array is usually '''NaN''' as well. '''NaN''' values result from indeterminate operations such as &amp;lt;code&amp;gt;0/0&amp;lt;/code&amp;gt;. They propagate forward in this fashion to ensure that you will not accidentally compute an indeterminate result without realizing it. However, in some cases you might wish to ignore '''NaN''' values in an array-reducing operation. The functions [[Sum]], [[Product]], [[Average]], [[Min]], and [[Max]] all accept an optional parameter, «ignoreNaN» that can be set to True. «IgnoreNan» requires a named-parameter syntax, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNaN: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ignoreNonNumbers''': When the parameter contains both text and numbers, you can instruct [[Sum]], [[Min]] and [[Max]] to ignore the non-numeric values using the optional «ignoreNonNumbers» parameter, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNonNumbers: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reduce over multiple indexes:''' Most array-reducing functions, including [[Sum]], [[Product]], [[Average]], [[Min]], [[Max]], [[ArgMin]], and [[ArgMax]], let you specify more than one index. This is a convenient way to reduce over multiple indexes in a single call, for example:&lt;br /&gt;
&lt;br /&gt;
:Sum(x, i, j, k)&lt;br /&gt;
&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
:Sum(Sum(Sum(x, i), j), k)&lt;br /&gt;
&lt;br /&gt;
'''Reduce over all indexes''': You can sum over ''all'' the indexes of an array without having to list them explicitly:&lt;br /&gt;
:Sum(x, ... IndexesOf(x))&lt;br /&gt;
This necessarily returns a scalar -- i.e. value with no index. See [[Repeated Parameter Forwarding]] for details.&lt;br /&gt;
&lt;br /&gt;
Below we describe the most common array-reducing functions.&lt;br /&gt;
&lt;br /&gt;
==Sum(x, ''i'')==&lt;br /&gt;
Returns the sum of array «x» over the dimension indexed by «i».&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Product(x,''i'')==&lt;br /&gt;
Returns the product of all of the elements of «x», along the dimension indexed by «i». See also [[Product]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Product(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 7.2T&lt;br /&gt;
| 8.398T&lt;br /&gt;
| 10.08Y&lt;br /&gt;
| 12.54T&lt;br /&gt;
| 15.36T&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Average(x, ''i'')==&lt;br /&gt;
Returns the mean value of all of the elements of array «x», averaged over index «i». See also [[Average]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Average(Miles, Years)&amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 8000&lt;br /&gt;
| 12K&lt;br /&gt;
| 7600&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Max(x, i)==&lt;br /&gt;
Returns the highest valued element of «x» along index «i». See also [[Max]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 10K&lt;br /&gt;
| 12K&lt;br /&gt;
| 10K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the maximum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max([10, 5]) &amp;amp;rarr; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Min(x, ''i'')==&lt;br /&gt;
Returns the lowest valued element of «x» along index «i». See also [[Min]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 6000&lt;br /&gt;
| 10K&lt;br /&gt;
| 5000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the minimum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min([10, 5]) &amp;amp;rarr; 5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ArgMax(a, i)==&lt;br /&gt;
Returns the item of index «i» for which array «a» is the maximum. If «a» has more than one value equal to the maximum, it returns the index of the last one. See also [[ArgMax]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMax(Miles, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ArgMin(a, i)==&lt;br /&gt;
Returns the corresponding value in index «i» for which array «a» is the minimum. If more than one value equals the minimum, returns the index of the last occurrence. See also [[ArgMin]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMin(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;text-align: left;&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| VW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CondMin(x, cond, i) and CondMax(x, cond, i)==&lt;br /&gt;
 [[CondMin]]() &amp;quot;conditional min&amp;quot; returns the smallest value along a given index, «i», that satisfies condition «cond».&lt;br /&gt;
Similarly, [[CondMax]]() returns the largest  When «cond» is never satisfied, [[CondMin]]() returns [[INF]] and [[CondMax]]() returns &amp;lt;code&amp;gt;-INF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' none&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;CondMin(Cost_of_ownership, Time &amp;gt;= 2, Time) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 3098&lt;br /&gt;
| 3897&lt;br /&gt;
| 3409&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==SubIndex(a, u, i)==&lt;br /&gt;
Does a lookup (similar to VLookup and Hlookup in Excel) returning the value of  index «i» of array «a» for which «a» equals «u» -- in other words, it returns the value &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; of index «i» for which array «a»[«i» = &amp;lt;code&amp;gt;vi] =&amp;lt;/code&amp;gt; «u». If «a» contains multiple values equal to «u», it returns the last value of «i» that matches. If no value of «a» equals «u», it returns [[Null]]. If «a» has index(es) in addition to «i», or if «u» is an array with other indexes, those indexes also appear in the result. See also [[SubIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 2007&lt;br /&gt;
| 2005&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If «u» is an array of values, an array of index values is returned.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, [18K, 19K] Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
!Subindex &amp;amp;#9660;&lt;br /&gt;
!2005&lt;br /&gt;
!2006&lt;br /&gt;
!2007&lt;br /&gt;
!2008&lt;br /&gt;
!2009&lt;br /&gt;
|-&lt;br /&gt;
|'''18K'''&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|«null»&lt;br /&gt;
|-&lt;br /&gt;
|'''19K'''&lt;br /&gt;
|«null»&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PositionInIndex(a, x, i)==&lt;br /&gt;
Returns the position &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; in index «i» for which x[@i = &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;] = x — that is, a number from 1 to the size of index «i» — of the last element of array «a» equal to «x». If no element of «a» matches  «x», it returns 0.  See also [[PositionInIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['A', 'B', 'C']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Array(I, [1, 2, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 1, I) &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 2, I) &amp;amp;rarr; 3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 5, I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;[[PositionInIndex]]() is the positional equivalent of [[Subindex]](). It is useful when «i» contains duplicate values, in which case [[Subindex]]() would return an ambiguous result.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;Parameter a is optional. When omitted, it returns the position of x in the index i, or 0 if not found. The syntax &amp;lt;code&amp;gt;@[i = x]&amp;lt;/code&amp;gt; (see [[Subscript and slice of a subarray#@: Index Position Operator|@: Index Position Operator]]) returns the same result as &amp;lt;code&amp;gt;PositionInIndex(, x, i)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'B', I) &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'B'] &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'D', I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'D'] &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the array is multidimensional:&lt;br /&gt;
Taking the same example from above:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Area(y, x, ''x1, x2, i'')==&lt;br /&gt;
Returns the area (sum of trapezoids) under the piecewise-linear curve denoted by the points&lt;br /&gt;
(«x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;», «y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;»), landing in the region «x1» &amp;amp;le; «x» &amp;amp;le;  «x2». The arrays «x» and «y» must share the common index «i», or when either «x» or «y» is itself an index, «i» can be safely omitted. «x» and «x2» are optional; if they are not specified, the area is calculated across all values of «x».&lt;br /&gt;
&lt;br /&gt;
If «x1» or «x2» fall outside the range of values in «i», the first value (for «x1») or last value (for «x1») are used. [[Area]]() computes the total integral across «x», returning a value with one less dimension than «y». Compare [[Area]]() to [[Transforming functions#Integrate()|Integrate()]].&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example''' &lt;br /&gt;
:&amp;lt;code&amp;gt;Area(Cost_of_ownership, Time, 0, 2) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 5905&lt;br /&gt;
| 7563&lt;br /&gt;
| 6591&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Tutorial: Arrays#Array_Reducing_Functions|Tutorial: Array Reducing Functions]]&lt;br /&gt;
* [[:Category:Array-reducing functions]]&lt;br /&gt;
* [[Tutorial: Arrays#Reducing_an_array_using_subscripts|Tutorial: Reducing an array using subscripts]]&lt;br /&gt;
* [[Sum]]()&lt;br /&gt;
* [[Product]]()&lt;br /&gt;
* [[Average]]()&lt;br /&gt;
* [[Functions Min and Max]]&lt;br /&gt;
* [[Max]]()&lt;br /&gt;
* [[Min]]()&lt;br /&gt;
* [[ArgMax]]()&lt;br /&gt;
* [[ArgMin]]()&lt;br /&gt;
* [[CondMin]]()&lt;br /&gt;
* [[CondMax]]()&lt;br /&gt;
* [[SubIndex]]()&lt;br /&gt;
* [[PositionInIndex]]()&lt;br /&gt;
* [[Area]]()&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Multidimensional array]]&lt;br /&gt;
* [[Relational tables and multiD arrays]]&lt;br /&gt;
* [[Repeated Parameter Forwarding|Reducing over all indexes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Functions that create arrays / {{PAGENAME}} / Transforming functions&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61857</id>
		<title>Array-reducing functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Array-reducing_functions&amp;diff=61857"/>
		<updated>2024-11-23T19:19:05Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Array-reducing functions]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Array functions &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
An '''array-reducing function''' aggregates across an Index (dimension) of an array and returns a result without that Index. So reduces the number of dimensions of that array by one (or more). Examples include, [[Sum]](x, i), [[Product]](x, i), [[Max]](x, i), [[Min]](x, i), and others described below. The [[Subscript and slice of a subarray |subscript]] construct [[Subscript-Slice_Operator|x[i = v]]] and related slice functions also reduce arrays by a dimension.&lt;br /&gt;
&lt;br /&gt;
The function [[Sum]](x, i) illustrates some properties of reducing functions.&lt;br /&gt;
&lt;br /&gt;
'''Examples''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 59K&lt;br /&gt;
| 62K&lt;br /&gt;
| 66K&lt;br /&gt;
| 71K&lt;br /&gt;
| 76K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Sum(Car_prices, Years), Car_type) &amp;amp;rarr; 334K&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;The second parameter, «i», specifying the dimension over which to sum, is optional. But if the array, «x», has more than one dimension, Analytica might not sum over the dimension you expect. For this reason, it is safer always to specify the dimension index explicitly in [[Sum]]() or any other array-reducing function.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reducing over an unused index:''' If the index, «i», is not a dimension of «x», [[Sum]](x, i) returns «x» unreduced (i.e., with the same number of indexes), but multiplied by the size (number of elements) of «i». The reason is that if «x» is not indexed by «i», it means that it has the same value for all values of «i». This is true even if «x» is an atom with no dimensions:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable x := 5&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(x, Car_type) &amp;amp;rarr; 15&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; has three elements (3 x 5 = 15). &lt;br /&gt;
&lt;br /&gt;
In this way, if we later decide to change the value for &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; for each value of &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;, we can redefine «x» as an edit table indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt;. Any expression containing a [[Sum]]() or other reducing function on «x» works correctly whether it is indexed by &amp;lt;code&amp;gt;Car_type&amp;lt;/code&amp;gt; or not.&lt;br /&gt;
&lt;br /&gt;
'''Elements that are ignored:''' These array-reducing functions ignore elements of an array that contain [[Null]]. For example, the [[Average]](x, i) function sums all the non-null elements of «x» and divides by the number of non-null elements.&lt;br /&gt;
&lt;br /&gt;
'''IgnoreNaN''': When a '''NaN''' value (an indeterminate number) appears as an element of an array, the result of a function that operates on the array is usually '''NaN''' as well. '''NaN''' values result from indeterminate operations such as &amp;lt;code&amp;gt;0/0&amp;lt;/code&amp;gt;. They propagate forward in this fashion to ensure that you will not accidentally compute an indeterminate result without realizing it. However, in some cases you might wish to ignore '''NaN''' values in an array-reducing operation. The functions [[Sum]], [[Product]], [[Average]], [[Min]], and [[Max]] all accept an optional parameter, «ignoreNaN» that can be set to True. «IgnoreNan» requires a named-parameter syntax, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNaN: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ignoreNonNumbers''': When the parameter contains both text and numbers, you can instruct [[Sum]], [[Min]] and [[Max]] to ignore the non-numeric values using the optional «ignoreNonNumbers» parameter, for example:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(x, i, ignoreNonNumbers: True)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reduce over multiple indexes:''' Most array-reducing functions, including [[Sum]], [[Product]], [[Average]], [[Min]], [[Max]], [[ArgMin]], and [[ArgMax]], let you specify more than one index. This is a convenient way to reduce over multiple indexes in a single call, for example:&lt;br /&gt;
&lt;br /&gt;
:Sum(x, i, j, k)&lt;br /&gt;
&lt;br /&gt;
This is equivalent to:&lt;br /&gt;
:Sum(Sum(Sum(x, i), j), k)&lt;br /&gt;
&lt;br /&gt;
'''Reduce over all indexes''': You can sum over ''all'' the indexes of an array without having to list them explicitly:&lt;br /&gt;
:Sum(x, ... IndexesOf(x))&lt;br /&gt;
This necessarily returns a scalar -- i.e. value with no index. See [[Repeated Parameter Forwarding]] for details.&lt;br /&gt;
&lt;br /&gt;
Below we describe the most common array-reducing functions.&lt;br /&gt;
&lt;br /&gt;
==Sum(x, ''i'')==&lt;br /&gt;
Returns the sum of array «x» over the dimension indexed by «i».&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Sum(Car_prices, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 99K&lt;br /&gt;
| 103K&lt;br /&gt;
| 141K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Product(x,''i'')==&lt;br /&gt;
Returns the product of all of the elements of «x», along the dimension indexed by «i». See also [[Product]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Product(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 7.2T&lt;br /&gt;
| 8.398T&lt;br /&gt;
| 10.08Y&lt;br /&gt;
| 12.54T&lt;br /&gt;
| 15.36T&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Average(x, ''i'')==&lt;br /&gt;
Returns the mean value of all of the elements of array «x», averaged over index «i». See also [[Average]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Average(Miles, Years)&amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 8000&lt;br /&gt;
| 12K&lt;br /&gt;
| 7600&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Max(x, i)==&lt;br /&gt;
Returns the highest valued element of «x» along index «i». See also [[Max]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 10K&lt;br /&gt;
| 12K&lt;br /&gt;
| 10K&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the maximum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Max([10, 5]) &amp;amp;rarr; 10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''See [[Array Function Example Variables]] for example array variables used here and below.''&lt;br /&gt;
&lt;br /&gt;
==Min(x, ''i'')==&lt;br /&gt;
Returns the lowest valued element of «x» along index «i». See also [[Min]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min(Miles, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 6000&lt;br /&gt;
| 10K&lt;br /&gt;
| 5000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To obtain the minimum of two numbers, first turn them into an array:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Min([10, 5]) &amp;amp;rarr; 5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ArgMax(a, i)==&lt;br /&gt;
Returns the item of index «i» for which array «a» is the maximum. If «a» has more than one value equal to the maximum, it returns the index of the last one. See also [[ArgMax]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMax(Miles, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
| Honda&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ArgMin(a, i)==&lt;br /&gt;
Returns the corresponding value in index «i» for which array «a» is the minimum. If more than one value equals the minimum, returns the index of the last occurrence. See also [[ArgMin]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;ArgMin(Car_prices, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;text-align: left;&amp;quot; | Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| BMW&lt;br /&gt;
| VW&lt;br /&gt;
| VW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CondMin(x, cond, i) and CondMax(x, cond, i)==&lt;br /&gt;
 [[CondMin]]() &amp;quot;conditional min&amp;quot; returns the smallest value along a given index, «i», that satisfies condition «cond».&lt;br /&gt;
Similarly, [[CondMax]]() returns the largest  When «cond» is never satisfied, [[CondMin]]() returns [[INF]] and [[CondMax]]() returns &amp;lt;code&amp;gt;-INF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Library:''' none&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;CondMin(Cost_of_ownership, Time &amp;gt;= 2, Time) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 3098&lt;br /&gt;
| 3897&lt;br /&gt;
| 3409&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==SubIndex(a, u, i)==&lt;br /&gt;
Does a lookup (similar to VLookup and Hlookup in Excel) returning the value of  index «i» of array «a» for which «a» equals «u» -- in other words, it returns the value &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; of index «i» for which array «a»[«i» = &amp;lt;code&amp;gt;vi] =&amp;lt;/code&amp;gt; «u». If «a» contains multiple values equal to «u», it returns the last value of «i» that matches. If no value of «a» equals «u», it returns [[Null]]. If «a» has index(es) in addition to «i», or if «u» is an array with other indexes, those indexes also appear in the result. See also [[SubIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Examples:''' &lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| Honda&lt;br /&gt;
| «null»&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, 18K, Years) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 2007&lt;br /&gt;
| 2005&lt;br /&gt;
| «null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If «u» is an array of values, an array of index values is returned.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SubIndex(Car_prices, [18K, 19K] Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
!Subindex &amp;amp;#9660;&lt;br /&gt;
!2005&lt;br /&gt;
!2006&lt;br /&gt;
!2007&lt;br /&gt;
!2008&lt;br /&gt;
!2009&lt;br /&gt;
|-&lt;br /&gt;
|'''18K'''&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|«null»&lt;br /&gt;
|-&lt;br /&gt;
|'''19K'''&lt;br /&gt;
|«null»&lt;br /&gt;
|Honda&lt;br /&gt;
|«null»&lt;br /&gt;
|VW&lt;br /&gt;
|«null»&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PositionInIndex(a, x, i)==&lt;br /&gt;
Returns the position &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; in index «i» for which x[@i = &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;] = x — that is, a number from 1 to the size of index «i» — of the last element of array «a» equal to «x». If no element of «a» matches  «x», it returns 0.  See also [[PositionInIndex]]().&lt;br /&gt;
&lt;br /&gt;
'''Example:''' &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['A', 'B', 'C']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Array(I, [1, 2, 2])&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 1, I) &amp;amp;rarr; 1&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 2, I) &amp;amp;rarr; 3&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(A, 5, I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;[[PositionInIndex]]() is the positional equivalent of [[Subindex]](). It is useful when «i» contains duplicate values, in which case [[Subindex]]() would return an ambiguous result.&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tip title=&amp;quot;Tip&amp;quot;&amp;gt;Parameter a is optional. When omitted, it returns the position of x in the index i, or 0 if not found. The syntax &amp;lt;code&amp;gt;@[i = x]&amp;lt;/code&amp;gt; (see [[Subscript and slice of a subarray#@: Index Position Operator|@: Index Position Operator]]) returns the same result as &amp;lt;code&amp;gt;PositionInIndex(, x, i)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'B', I) &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'B'] &amp;amp;rarr; 2&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(, 'D', I) &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;@[I = 'D'] &amp;amp;rarr; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/Tip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the array is multidimensional:&lt;br /&gt;
Taking the same example from above:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;PositionInIndex(Car_prices, 18K, Car_type) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;5&amp;quot;| Years &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2005            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2006            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2007            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2008            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''2009            '''&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Area(y, x, ''x1, x2, i'')==&lt;br /&gt;
Returns the area (sum of trapezoids) under the piecewise-linear curve denoted by the points&lt;br /&gt;
(«x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;», «y&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;»), landing in the region «x1» &amp;amp;le; «x» &amp;amp;le;  «x2». The arrays «x» and «y» must share the common index «i», or when either «x» or «y» is itself an index, «i» can be safely omitted. «x» and «x2» are optional; if they are not specified, the area is calculated across all values of «x».&lt;br /&gt;
&lt;br /&gt;
If «x1» or «x2» fall outside the range of values in «i», the first value (for «x1») or last value (for «x1») are used. [[Area]]() computes the total integral across «x», returning a value with one less dimension than «y». Compare [[Area]]() to [[Transforming functions#Integrate()|Integrate()]].&lt;br /&gt;
&lt;br /&gt;
'''Library:''' Array&lt;br /&gt;
&lt;br /&gt;
'''Example''' &lt;br /&gt;
:&amp;lt;code&amp;gt;Area(Cost_of_ownership, Time, 0, 2) &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Car_type &amp;amp;#9654;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''VW            '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''Honda           '''&lt;br /&gt;
! style=&amp;quot;width:75px;&amp;quot; |'''BMW           '''&lt;br /&gt;
|-&lt;br /&gt;
| 5905&lt;br /&gt;
| 7563&lt;br /&gt;
| 6591&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:2;-moz-column-count:2;-webkit-column-count:2&amp;quot;&amp;gt;&lt;br /&gt;
* [[Tutorial: Arrays#Array_Reducing_Functions|Tutorial: Array Reducing Functions]]&lt;br /&gt;
* [[:Category:Array-reducing functions]]&lt;br /&gt;
* [[Tutorial: Arrays#Reducing_an_array_using_subscripts|Tutorial: Reducing an array using subscripts]]&lt;br /&gt;
* [[Sum]]()&lt;br /&gt;
* [[Product]]()&lt;br /&gt;
* [[Average]]()&lt;br /&gt;
* [[Functions Min and Max]]&lt;br /&gt;
* [[Max]]()&lt;br /&gt;
* [[Min]]()&lt;br /&gt;
* [[ArgMax]]()&lt;br /&gt;
* [[ArgMin]]()&lt;br /&gt;
* [[CondMin]]()&lt;br /&gt;
* [[CondMax]]()&lt;br /&gt;
* [[SubIndex]]()&lt;br /&gt;
* [[PositionInIndex]]()&lt;br /&gt;
* [[Area]]()&lt;br /&gt;
* [[Function calls and parameters]]&lt;br /&gt;
* [[Multidimensional array]]&lt;br /&gt;
* [[Relational tables and multiD arrays]]&lt;br /&gt;
* [[Repeated Parameter Forwarding|Reducing over all indexes]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Functions that create arrays / {{PAGENAME}} / Transforming functions&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Managing_windows&amp;diff=61853</id>
		<title>Managing windows</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Managing_windows&amp;diff=61853"/>
		<updated>2024-11-22T23:45:52Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Windows and dialogs]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Working with Large Models &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could theoretically open hundreds of [[Diagram window|Diagram]], [[Object window|Object]], and [[Result window|Result]] windows in a model. To avoid cluttering your screen, Analytica limits the number of windows that can be open at once. The default limit is 4 windows of any type.  (Dialogs do not count as windows.)  If you open a new window when you already have 4 open, it automatically closes the window that has been inactive the longest.&lt;br /&gt;
&lt;br /&gt;
You can change this limit in the [[Preferences dialog]], which you can open from the from the [[Edit menu]] . Select a different number from the &amp;quot;Max open windows'' menu:&lt;br /&gt;
:[[File:Chapter19_19.png]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Diagram window]]&lt;br /&gt;
* [[Object window]]&lt;br /&gt;
* [[Result window]]&lt;br /&gt;
* [[Preferences]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Making a browse-only model and hiding definitions / {{PAGENAME}} / Memory usage and management&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_5.2%3F&amp;diff=61840</id>
		<title>What's new in Analytica 5.2?</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_5.2%3F&amp;diff=61840"/>
		<updated>2024-11-22T03:12:16Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Emergent iteration constructs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:What's new pages]]&lt;br /&gt;
&amp;lt;!--The current release is [[Analytica 5.1]]. Analytica 5.2 is currently in beta testing. If you have an Analytica subscription, we invite you to become beta tester of Analytica 5.2. Visit the [[Beta Tester Page]] for details.&lt;br /&gt;
&lt;br /&gt;
As usual with a new release, Analytica 5.2 includes many improvements and bug fixes. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
For most users, the most valuable new features are about graphing:&lt;br /&gt;
&lt;br /&gt;
* '''Zoom into graphs''': Press your mouse button within a graph and drag the cursor to show a rectangle to get a close up view of that part of the graph. You can do this horizontally to zoom into part of the X axis, vertically to zoom the Y axis, or both together. &lt;br /&gt;
&lt;br /&gt;
* '''Hide elements on a graph:''' Further enhances on a popular feature introduced in [[Analytica 5.1]] that gives you the option to hide some lines on a graph. Click an element in the key to toggle whether to hide or show the corresponding line.  If there are many key items, and you want to show just one or a few, you can now  select '''Turn off all key items''' from the right-click menu in the Key. Then you can click just those few key items you want to show. &lt;br /&gt;
&lt;br /&gt;
* '''Combine symbols and lines:'''  You can show some data sets as symbols and others as a continuous line in the same graph -- for example, to show a regression line fitted to data points. In '''Graph setup''' / '''Chart type''', select the second '''Line style''' which shows lines ''and'' symbols. In the Graph, you can now click each element in the Key to display line only, symbol only, both line and symbol, or neither (to hide that data) by successive clicks.  To save these options for future views of the graph, select '''Save key item visibility''' from the '''right-click menu'''.&lt;br /&gt;
:::[[File:Graph setup dialog with Line style lines and symbols.png|200px]] &lt;br /&gt;
&lt;br /&gt;
* '''Show and fill regions on a map:'''  Given a series of points with longitude and latitude, you can show them as regions. You should select the longitude and latitude values as X and Y values using [[XY Comparison|XY]] plot. The  '''Graph setup''' / '''Chart type''' then shows a new '''Fill type''' option, which lets you fill in each polygon with a color.&lt;br /&gt;
&lt;br /&gt;
* '''OnGraphDraw attribute:''' Lets you draw points, lines, areas, and text on a graph to annotate it, for example to point out a maximum, minimum value, add labels to points, or even show points on a Google map.  &lt;br /&gt;
&lt;br /&gt;
* '''Multiple results from a function:''' A function can now return multiple results of different dimensions.  You can assign multiple results to multiple local variables, for example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Local (txt, filename) :=  ReadTextFile('Import file.txt', Dialog: True);&amp;lt;/code&amp;gt;&lt;br /&gt;
[[ReadTextFile]] now returns the file name as its second result in addition to the actual text contents of the file as its first result. This is useful if the user may select a different file from the default on specified as first parameter. Several other built-in functions that access files also now return the file name as a second result. You can also define user defined functions to return multiple results, using this construct, usually as the last expression in its definition:&lt;br /&gt;
:::&amp;lt;code&amp;gt;[[MultiResult]]( v1, v2, v3)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Extended syntax for locals and assignment:'''  As shown above, you can declare multiple local variables at once. You can also assign to multiple local variables outside a declaration:&lt;br /&gt;
:::&amp;lt;code&amp;gt;(txt, filename) :=  ReadTextFile('Import file.txt', Dialog: True);&amp;lt;/code&amp;gt;&lt;br /&gt;
You can declare multiple locals together as:&lt;br /&gt;
:::&amp;lt;code&amp;gt;Local x := 1, y := 2, z := 3;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See below for more on these and other new features.&lt;br /&gt;
&lt;br /&gt;
___TOC___&lt;br /&gt;
&lt;br /&gt;
== Graphing ==&lt;br /&gt;
&lt;br /&gt;
=== Interactive zooming ===&lt;br /&gt;
&lt;br /&gt;
When you first show a result as a graph, it automatically set the ranges for the vertical and horizontal axes so that all data points are visible (ignoring values containing [[INF, NAN, and NULL - Exception values|INF, NAN, or Null]]).  Now, you can zoom in to show just part of the graph by dragging the cursor.  Drag the cursor horizontally from a low to high value to zoom in along the horizontal axis. Drag it vertically to zoom along the vertical axis. Drag it diagonally to create a rectangle to zoom in on both axes. It records the zoomed min and max values in the Axis ranges tab of Graph setup as if you had set them manually.&lt;br /&gt;
&lt;br /&gt;
* Drag the mouse horizontally to zoom to a manually-scaled x-axis interval:&lt;br /&gt;
::[[image:graph_zoom_horiz.png]] &amp;amp;rarr; [[image:graph_zoom_horiz_after.png]]&lt;br /&gt;
::Transparent blue selection rectangle appears while dragging. After drag, Y is still autoscaled, but now to the data in the selected range.&lt;br /&gt;
* Drag the mouse diagonally to zoom to manually-scaled intervals on both axes:&lt;br /&gt;
::[[image:graph_zoom_diag.png]] &amp;amp;rarr; [[image:graph_zoom_diag_after.png]]&lt;br /&gt;
* When you move the mouse over a zoomed graph, autoscale hover icon buttons appear. Click on one to auto-scale that axis.&lt;br /&gt;
::[[image:graph_zoom_autoscale.png]] &amp;amp;rarr; [[image:graph_zoom_autoscaley_after.png]]&lt;br /&gt;
::Clicked on the vertical axis autoscale hover icon. Horizontal axis is still manually scaled.&lt;br /&gt;
* Drag vertically to zoom to a manually-scaled y-axis interval.&lt;br /&gt;
::[[image:graph_zoom_vert.png]] &amp;amp;rarr; [[image:graph_zoom_vert_after.png]]&lt;br /&gt;
* Zooming has the same effect as changing the manual scale range in Graph Setup. In fact, it records your selected end points there.&lt;br /&gt;
::[[image:graph_zoom_graphsetup_after.png]]&lt;br /&gt;
&lt;br /&gt;
=== Key item visibility states ===&lt;br /&gt;
&lt;br /&gt;
Analytica 5.2 further enhances the popular feature (introduced in [[Analytica 5.1]]) that lets you click on each item in Graph Key to show or hide the corresponding line or bar. See [[Toggling Key Item Visibility]].&lt;br /&gt;
&lt;br /&gt;
==== Turn on all, Turn off all ====&lt;br /&gt;
&lt;br /&gt;
Right-click on a graph Key to see menu options '''Turn on all key items''' and '''Turn off all key items'''. Use these when you want to show or hide almost all of them. They save you many clicks when there are a lot of key items.&lt;br /&gt;
&lt;br /&gt;
==== Show lines and symbols  ====&lt;br /&gt;
&lt;br /&gt;
You can now show a graph with some data as symbols only, some as lines without symbols, and some lines and symbols.  This is very useful when you want to show data points and a line fitted to those points on the same graph.&lt;br /&gt;
::[[image:Line and point graph.png]]&lt;br /&gt;
&lt;br /&gt;
To achieve this, select the Line+Symbol plot style:&lt;br /&gt;
:[[image:How to line and point graph.png]]&lt;br /&gt;
Initially, every data series (key item) has lines and symbols (as before).  Click on each Key item to toggle it from line+symbol to line-only to symbol-only, and back to line+symbol. So with just a few clicks, you can select how to display each each series.&lt;br /&gt;
&lt;br /&gt;
What if your graph has multiple keys, line and symbol or symbol size each depicting different information?  You can then toggle each element on each key separately through three states: On to Off to Partial, and back to On. In the Off state, it hides both lines and symbols. In the Partial state on the Line key, it hides the line but shows the symbols.  Or in the Symbol Key, when an item is Partial, it shows the line but not the symbol.  &lt;br /&gt;
&lt;br /&gt;
::[[image:graph_key_symbol_partial.png]]&lt;br /&gt;
&lt;br /&gt;
In the above graph, the 2 points corresponding to '''Least''' would appear at x=2 in the fully-on graph, but fit_err=Least is been clicked once, putting it into the off state. As a result, there is a gap in the lines at x=2. In the symbol size key (x cat), the x_cat=8 item is in the partial state. The points corresponding to x_cat=8 appear at x=8. In this case the lines pass through the points, but the symbols are hidden. &lt;br /&gt;
&lt;br /&gt;
When fit_graph=y in the line key is off, all the red &amp;quot;ink&amp;quot; on the graph disappears. But when it is in the partial state, the line disappears but the symbols continue to show, as illustrated here:&lt;br /&gt;
::[[image:graph_key_line_partial.png]]&lt;br /&gt;
&lt;br /&gt;
==== Save visibility states ====&lt;br /&gt;
Changes to key item visibility reset by default when you close and re-open a graph anew. If you want your current visibility state to be saved as the starting point next time the graph is opened, select '''Save key item visibilities''' from the right-mouse menu.&lt;br /&gt;
&lt;br /&gt;
=== Polygon fill plots ===&lt;br /&gt;
When you plot a curve in an X-Y plot, there is now a polygon fill option that fills the interior of the polygon(s). For example, starting with this data, already plotted as Latitude vs Longitude&lt;br /&gt;
::[[image:California_unfilled_plot.png]]&lt;br /&gt;
you can use the new Polygon fill type (the Fill type option is new).&lt;br /&gt;
::[[image:Graph_setup_polygon_filltype.png]]&lt;br /&gt;
The difference between alternate and solid arises when a curve crosses itself. In this example with a state outline, that doesn't happen so they are equivalent.  Polygon fill closes each curve segment (null data starts a new segment) and fills the interior.&lt;br /&gt;
::[[image:California_filled_plot.png]]&lt;br /&gt;
and viola!&lt;br /&gt;
::[[image:Red state blue state.png]]&lt;br /&gt;
&lt;br /&gt;
=== OnGraphDraw ===&lt;br /&gt;
You can use the [[OnGraphDraw]] attribute to adorn or customize your graphs in various ways. You can enter an expression that gets evaluated at any of 4 phases during the graph rendering. A [[Canvas]] is provided that you can draw on using the [[Drawing images|canvas drawing functions]]. &lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
Using [[OnGraphDraw]], by drawing on the canvas ''after'' the graph has been rendered, you you can annotate points on a plot such as the maximum or minimum, label a threshold level, draw error bars or labels for individual points.&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw min and max.png]]&lt;br /&gt;
[[image:OnGraphDraw threshold.png|400px]]&lt;br /&gt;
[[image:OnGraphDraw_ErrorBars.png|400px]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By drawing ''after'' the axes have been scaled, but before the data has been plotted, you can draw under the data, or replace the rendering of the data entirely, such as by replacing probability bands with Tukey bars that your code renders.&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw_TukeyBands.png|400px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also draw a Google map under the data (Analytica Enterprise is required to support the functions necessary for downloading a Google map).&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw map.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
The Google map also requires running the [[OnGraphDraw]] after the graph is laid out, but before the axes are drawn, at which opportunity it can register the actual latitute/longitude axis scale to match the downloaded map.&lt;br /&gt;
&lt;br /&gt;
Finally, you can draw ''before'' anything has been drawn to completely replace the graph with a totally customized data depiction, such as a pie chart, dendritic tree, etc.&lt;br /&gt;
&lt;br /&gt;
==== Using OnGraphDraw ====&lt;br /&gt;
* To use OnGraphDraw, go to the [[Attributes dialog]] and enable it for Variables. It appears there now.&lt;br /&gt;
* On the [[Object window]] for the variable on interest, the [[OnGraphDraw]] attribute appears, along with a series of check box where you can select which phases of drawing you want your code called. &lt;br /&gt;
* Several local variables are provided to [[OnGraphDraw]]: &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;. These supply the canvas, information about the graph itself and its layout, the pivot (roles) of the graph, and which phase of rendering is being processed. You can set &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; to tell it not to draw further, or set &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt; to make actual changes (like when registering actual latitude bounds of a Google map).&lt;br /&gt;
* The new [[GraphToCanvasCoord]] function makes it easy to find the pixel location for a data point, based on the data's own units.&lt;br /&gt;
&lt;br /&gt;
See [[OnGraphDraw]] for instructions on how to use this.&lt;br /&gt;
&lt;br /&gt;
Specific adornments or novel plot types can be encapsulated as [[User-Defined Functions]] and bundled in libraries, so that with these you need only add a function call in [[OnGraphDraw]] and check the appropriate phase check boxes. We have not released any such library yet, but may post libraries like this on the Analytica Wiki and Analytica blog in the future, so stay tuned.&lt;br /&gt;
&lt;br /&gt;
=== Other graphing ===&lt;br /&gt;
&lt;br /&gt;
* Bug fix impacting marginal abatement graphs&lt;br /&gt;
* Changing symbol size role less likely to swap other roles, less confusing&lt;br /&gt;
&lt;br /&gt;
== Expression language &amp;amp; Engine ==&lt;br /&gt;
&lt;br /&gt;
=== Declaring local identifiers ===&lt;br /&gt;
&lt;br /&gt;
==== Omission of initial value====&lt;br /&gt;
&lt;br /&gt;
When declaring a local, you can now omit its initial value, so that &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x;&amp;lt;/code&amp;gt;&lt;br /&gt;
is equivalent to &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x := Null&amp;lt;/code&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
==== Multiple locals in one declaration ====&lt;br /&gt;
&lt;br /&gt;
You can declare multiple local identifiers in the same Local declaration. For example,&lt;br /&gt;
:&amp;lt;code&amp;gt;Local a, b := 5, c[ J ], d[ ] := Va1;&amp;lt;/code&amp;gt;&lt;br /&gt;
This is then equivalent to four separate declarations as follows&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[Local]] a:=[[Null]];&lt;br /&gt;
:[[Local]] b:=5;&lt;br /&gt;
:[[Local]] c[ J ] := [[Null]];&lt;br /&gt;
:[[Local]] d[ ] := Va1;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Capture of multiple return values ====&lt;br /&gt;
&lt;br /&gt;
Functions can now return multiple values, each with different dimensionality. This is covered below in [[#Multiple return values]]. These values can be captured by [[Local]] (or the other declaration constructs like [[For]], etc.) by placing the declared identifiers inside parentheses, as illustrated here:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (u,w,v) := [[SingularValueDecomp]]( a, I, J, J2 );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the function, [[SingularValueDecomp]] returns three matrices, each with a different dimensionality. With dimensional restrictions, this could also be declared as&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (u[I,J], w[J,J2], v[J,J2]) := [[SingularValueDecomp]]( a, I, J, J2 );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that [[SingularValueDecomp]] is called a single time, and returns three separate values. This function, as well as [[EigenDecomp]], behave differently when multiple return values are captured compared to when only the main value is used, which is done for backward compatibility with their legacy behavior. Previously, the returned a data structure with 3 [[references]] to the 3 matricies, which required some work to unpack. They illustrate that the capability to return multiple values isn't entirely new, but is far more convenient. These two functions are the only functions that change their behavior. For all other functions, when only the main value is used, the secondary return values are simply dropped (and are usually not computed in the first place). For example, in addition to reading the contents of a file, you can also capture the file name selected by the user using&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( txt, filename ) := [[ReadTextFile]](&amp;quot;&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but you don't need to capture filename if you don't need it, and can simple use&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] txt := [[ReadTextFile]](&amp;quot;&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Reduced keyword ====&lt;br /&gt;
&lt;br /&gt;
As with previous releases, you can declare the indexes that the value named by a local identifier is allowed to have using brackets, such as &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x[I, J, K] := Z;&amp;lt;/code&amp;gt;&lt;br /&gt;
When declared in this fashion, and expressions you include in the body (i.e., the lexical scope of these local identifiers) can be treated as if it does not contain any indexes not listed. The new keyword &amp;quot;&amp;lt;code&amp;gt;reduced&amp;lt;/code&amp;gt;&amp;quot; also restricts the dimensionality of a local variable, but in a somewhat different way. The same qualifier exists for [[Function parameter qualifiers|function parameter declarations]] and in fact works in exactly the same way here.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( a[ ], b reduced ) := _( X, Y );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; might need to be iterated over the indexes of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; will have the indexes of &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; that are not also indexes of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;. In addition, the slice of X or Y named by a or b is coordinated. When a names &amp;lt;code&amp;gt;X[J=3]&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; also names &amp;lt;code&amp;gt;Y[J=3]&amp;lt;/code&amp;gt;.  This leads to some convenient new iteration constructs. For example, you may have seen expressions such as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] n := @I Do (&lt;br /&gt;
::[[Local]] ii := I[@I=n]&lt;br /&gt;
::[[Local]] x_i := X[@I=n];&lt;br /&gt;
::…&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the ensuing looped body code makes use of the index position (n), the index label (ii), and the array slice (x_i), and so it has to extract two of the items from the loop variable. This can now be condensed to a single looping structure,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] (n[], ii[], x_i reduced) := _(@I, I, X) Do ( …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: In many cases, the word [[Local]] can be used in place of [[For]] here. Note that &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; names each position of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ii&amp;lt;/code&amp;gt; names each label of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;x_i&amp;lt;/code&amp;gt; names the slice of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; corresponding to &amp;lt;code&amp;gt;[@I=n]&amp;lt;/code&amp;gt;. This is similar to calling a function with &amp;lt;code&amp;gt;F(@I, I, X)&amp;lt;/code&amp;gt; with has Parameters declared as &lt;br /&gt;
:Function F(n,i : [] ; x_i : reduced)&lt;br /&gt;
&lt;br /&gt;
==== Iterating over repeated parameters (Local xi := repeated x Do) ====&lt;br /&gt;
&lt;br /&gt;
When a [[User-Defined Function]] has a repeated parameter, for example when its [[Parameters]] are:&lt;br /&gt;
:&amp;lt;code&amp;gt;( x : ... )&amp;lt;/code&amp;gt;&lt;br /&gt;
or equivalently&lt;br /&gt;
:&amp;lt;code&amp;gt;(x : repeated)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the &amp;quot;correct&amp;quot; way to iterate over the supplied parameters in the Definition of the UDF is now&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] xi := repeated x;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;repeated&amp;lt;/code&amp;gt; keyword at this position is recognized. So for example, if someone calls this function as&lt;br /&gt;
:&amp;lt;code&amp;gt;F(a,b,c)&amp;lt;/code&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; each have different dimensions, &amp;lt;code&amp;gt;xi&amp;lt;/code&amp;gt; will alias each of these values in turn. A couple syntactic variations are to use [[For]] in place of [[Local]], or to include parens around the name, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;[[For]] xi := repeated(x) Do ...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, you can also access these using, e.g., Slice(x,2) for the second repeated. It is best, however, not to treat the repeated &amp;quot;dimension&amp;quot; as you would the implicit dimension, otherwise you may end up with the union of the incoming dimensions.&lt;br /&gt;
&lt;br /&gt;
==== Preservation of local name instead of local1, local2 ====&lt;br /&gt;
&lt;br /&gt;
Prior to this release, the parse tree (an internal data structure) for an Analytica expression did not remember the local identifier. Instead, it numbered the locals, and so every once in a while you might encounter a situation where the identify of the local is extracted from the parse tree and appears as &amp;lt;code&amp;gt;local1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;local2&amp;lt;/code&amp;gt;, etc.  Analytica 5.2 now annotates the parse tree with the local identifier, so that depictions of the parse use the original names. For example, suppose &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt; is defined as&lt;br /&gt;
&lt;br /&gt;
 [[Local]] x := [[Sin]](angle);&lt;br /&gt;
 [[Local]] y := [[Cos]](angle);&lt;br /&gt;
 [x,y]&lt;br /&gt;
&lt;br /&gt;
You can see the difference here:&lt;br /&gt;
{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
|[[Image:LocalIdentsIn5.1.png]] || [[Image:LocalIdentsIn5.2.png]] &lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;center&amp;gt;In Analytica 5.1&amp;lt;/center&amp;gt; !! &amp;lt;center&amp;gt;In Analytica 5.2&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Multiple return values ===&lt;br /&gt;
&lt;br /&gt;
Functions can now return multiple values, each with potentially different indexes, not just a single value or array, as previously.  An expression calling the function may use only the first returned value, or it can use some or all of the values.  Several built-in functions return extra information in the second and third return values.&lt;br /&gt;
&lt;br /&gt;
==== Built-in functions that return multiple values ====&lt;br /&gt;
&lt;br /&gt;
These built-in functions read information from a file and return its contents in one way or other in the main value. Each has now been enhanced to return the file name that was opened as a second parameter. Since in each case, a user might potentially select a file from a file selector dialog, you would otherwise not knowing which file was actually read.  The primary return value is the same as in previous releases, the second return value is new.&lt;br /&gt;
&lt;br /&gt;
* [[ReadTextFile]]: Returns ( file_contents, filename )&lt;br /&gt;
* [[SpreadsheetOpen]]: Returns ( workbook, filename )&lt;br /&gt;
* [[ReadExportFile]]: Returns ( array, filename )&lt;br /&gt;
* [[ReadBinaryFile]]: Returns (date, filename)&lt;br /&gt;
* [[ReadImageFile]]: Returns (image, filename)&lt;br /&gt;
&lt;br /&gt;
Note: the Write functions don't yet return filenames in this fashion. &lt;br /&gt;
&lt;br /&gt;
* [[CanvasDrawText]] returns the coordinates of the bounding box of the text.&lt;br /&gt;
* [[Regression]] will return the bias coefficient as a second return value without having it included in the basis.&lt;br /&gt;
* [[MantissaAndExponent]] returns the mantissa and exponents as separate return values.&lt;br /&gt;
* [[MsgBox]] returns the check box state as a second return value.&lt;br /&gt;
&lt;br /&gt;
The function [[SingularValueDecomp]] computes three matrices, each with a different dimensionality. Formerly, these were returned as a vector of 3 [[reference]]s. You would then usually unpack this, extracting the three items. With the ability for it to return three return values, the call is more convenient, namely:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;(u, w, v) := [[SingularValueDecomp]]( a, I, J, J2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
eliminating the ugly unpacking code. To ensure backward compatibility with code that used the 3-reference data structure, it is able to detect when you are capturing multiple return values and return the 3-reference structure when you are not.  &lt;br /&gt;
&lt;br /&gt;
A similar enhancement applies to the [[EigenDecomp]] function, which returns a vector of eigen values and 2-D matrix of eigen vectors. Formerly, these were bundled using a reference for the eigen vectors, but with multiple return values it is convenient to immediately separate these, e.g.,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;(eigenVals, eigenVecs) := [[EigenDecomp]](a, I, J)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[EigenDecomp]] also retains its legacy behavior when you are not capturing multiple return values.&lt;br /&gt;
&lt;br /&gt;
The [[Regression]] function automatically adds a bias term to the basis and return the bias coefficient as the second return value when you capture the second return value. This means you can now find &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; for simple y=m*x+b regression for scalar x using just&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (m,b) := [[Regression]](y, x, I);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can include a checkbox on a message box displayed by [[MsgBox]](). When you do so, the state of the checkbox is returned as a second return value.&lt;br /&gt;
&lt;br /&gt;
==== Capturing multiple return values ====&lt;br /&gt;
When a function returns multiple return values, you have to capture these values. There are two ways of doing this: In a local declaration, or via the assignment operator (:=).&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]]( x, y, z ) := FuncWithMultiple(  );&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
:&amp;lt;code&amp;gt;(a, b, c) := FuncWithMultiple( );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When assignment is used, each destination (a, b and c) can be anything that could appear on the left-hand side of an normal assignment operator. This includes local identifiers, global variables (in contexts where a side-effect is legal), a slice of a local variable, an attribute of an object, etc. &lt;br /&gt;
&lt;br /&gt;
Although I'm showing the local declaration example using [[Local..Do]], you can also use other local declaration constructs in the same way, including [[For]] and [[LocalAlias]], or the legacy [[Var..Do]], [[Using..Do]], [[MetaVar..Do]], etc. &lt;br /&gt;
&lt;br /&gt;
When you capture a return value that isn't actually returned by the function, it is equivalent to capturing null. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;( x,y ) := [[Sqrt]](5)&amp;lt;/code&amp;gt;&lt;br /&gt;
sets &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; to 5 and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; to null.&lt;br /&gt;
&lt;br /&gt;
==== Returning multiple values from a UDF ====&lt;br /&gt;
To return multiple values from your own UDFs, simple return &lt;br /&gt;
:&amp;lt;code&amp;gt;[[MultiResult]]( v1, v2, v3, v4 )&amp;lt;/code&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;v1, v2, …&amp;lt;/code&amp;gt; are the expressions whose result is to be returned. Be aware that for any of these values that are not captured by the caller, the corresponding expression will not be evaluated. You can use that to your advantage by placing any time-consuming code not shared by v1 in the expression for v2, so that when the caller uses only v1, no wasted computation ensues. &lt;br /&gt;
&lt;br /&gt;
There is a synonymous syntax, &amp;lt;code&amp;gt;_( v1, v2, v3, v4 )&amp;lt;/code&amp;gt; that can be used. When returning values from a UDF, we feel that it clearer to call [[MultiResult]]. However, the underscore function is convenient when using a multiple assignment directly, such as &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (key[], val[]) := _( dict.Key, dict );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;lt;code&amp;gt;_( ) &amp;lt;/code&amp;gt; with [[Repeated parameter forwarding]] to accomplish something that would have taken four lines of code otherwise.&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (x,y,z) := _( ...[[ParseNumber]]( [[SplitText]]( &amp;quot;10, 20, 3&amp;quot;, &amp;quot;,&amp;quot; ) ) );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Emergent iteration constructs ====&lt;br /&gt;
&lt;br /&gt;
Some new convenient forms of iteration constructs emerge from the introduction of multiple return values. For example, when iterating over an index, you can simultaneously grab the index position and the index labels in the loop declaration.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] ( pos, label ) := _( @J, J ) Do …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
A 1-D array with an index containing labels is called as associative array in other programming languages. The index values are the keys and the array values are the values. Your iteration can conveniently name both the current key and the current value.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] ( key[], val reduced ) := _( I, a ) Do …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Assignment ===&lt;br /&gt;
* (Definition of X := array) -- setting cell expressions&lt;br /&gt;
* new ParseExpression() function&lt;br /&gt;
* Capturing multiple values&lt;br /&gt;
=== Multithreading ===&lt;br /&gt;
Added finer-grained control over which multi-threaded algorithms are enabled or disabled.  This is so that if you encounter a multi-threading-related problem with one particular algorithm, you can disable it without having to sacrifice all multi-threading.&lt;br /&gt;
&lt;br /&gt;
* [[DisableMultithreaded]]: New system variable that contains the flags.&lt;br /&gt;
* [[SetEvaluationFlag]]('multithreaded'): Function for turning on or off only within one expression.&lt;br /&gt;
&lt;br /&gt;
=== Experimental ===&lt;br /&gt;
You should not rely on experimental features while they are still experimental. They are subject to change or even cancellation in future releases, and are less thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
==== Sparse arrays ====&lt;br /&gt;
Analytica has long had support for a certain form of sparsity, which we call constant sparsity (or just const sparsity for short). When the values along a slice of an array don't vary (are constant), Analytica is often able to store the single value only, and also avoid an iteration during computations. However, many sparse arrays can't take advantage of const sparseness. We've been experimenting with fully sparse multi-dimensional arrays. With these, it is possible to have multidimensional cubes with large numbers of dimensions and immense numbers of distinct coordinates as long as the number of cell with actual data is relatively small. Such sparsity is often seen in [[MdTable]] relational-to-array transformations. &lt;br /&gt;
&lt;br /&gt;
You can use the same Analytica operators and functions on sparse arrays as you would on any other Analytica arrays, but when possible, Analytica will attempt to use sparse algorithms to process the only values that are present and produce a sparse array, maintaining fast and low-memory computation. With this we have been able to demonstrate some real-life computations on sparse BI hypercubes that were not previously possible (and which are not realistically possible with a relational table representation). &lt;br /&gt;
&lt;br /&gt;
Some operations produce non-sparse results, even when applied to sparse arrays. [[Cumulate]] applied to an array with a non-zero default value is one obvious example. This is a serious &amp;quot;gotcha&amp;quot;, because if you are manipulating arrays with quadrillions of cells, one application of a function like that and you've just created a multi-petabyte array.&lt;br /&gt;
&lt;br /&gt;
At present, only a subset of operations and functions that could have sparse-array-aware algorithms actually do; however, many of the ones that are present are the most common operations. But this incompleteness is one reason this is classified as an experimental feature.&lt;br /&gt;
&lt;br /&gt;
In addition, the sparse algorithms are at this point quite new and not battle tested, so it not unlikely that bugs may be lurking, including bugs that might produce incorrect results. One of the reasons we are including it as an experimental feature is to promote testing of the algorithms.&lt;br /&gt;
&lt;br /&gt;
===== Using sparse arrays =====&lt;br /&gt;
The use of sparse arrays is enabled by setting the system variable [[EnableSparse]] to 1.  Or, you can enable the production of a sparse array from a specific expression by using &amp;lt;code&amp;gt;[[SetEvaluationFlag]]('sparse', true', «expr»)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[MdTable]] is able to return a sparse array from a relational table, provided [[EnableSparse]] is set, or the sparse evaluation flag is on, or you set the optional «sparse» parameter to true. From there, the sparseness will propagate as you slice, add, and so on. &lt;br /&gt;
&lt;br /&gt;
Expressions like &amp;lt;code&amp;gt;a = b&amp;lt;/code&amp;gt; are often sparse, but will only return a sparse result when the evaluation context allows it. When these produce dense arrays, and those dense arrays are combined with sparse arrays, a lot of sparsity is often lost.&lt;br /&gt;
&lt;br /&gt;
== Built-in functions ==&lt;br /&gt;
=== with Multiple return values ===&lt;br /&gt;
The following built-in functions now return multiple results: [[ReadTextFile]], [[ReadImageFile]], [[ReadBinaryFile]], [[SpreadsheetOpen]], [[ReadExportFile]], [[SingularValueDecomp]], [[EigenDecomp]], [[MsgBox]], [[MantissaAndExponent]], [[CanvasDrawText]] and [[Regression]].&lt;br /&gt;
&lt;br /&gt;
See [[#Multiple return values]] above.&lt;br /&gt;
&lt;br /&gt;
=== New optional parameters to existing functions ===&lt;br /&gt;
* Added an optional parameter named «initially» parameter to [[ComputedBy]]. This provides an initial value for the parent variable, and retains the value assigned by the called in the definition. (But only when the value is a simple atom). For example, if you want to remember what file a user selected, you could use:&amp;lt;code&amp;gt;&lt;br /&gt;
 Variable filename := [[ComputedBy]](wb,&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 Variable wb := &lt;br /&gt;
      Local tmp; &lt;br /&gt;
      (tmp,filename) := [[SpreadsheetOpen]](filename); &lt;br /&gt;
      tmp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Added an optional Boolean parameter, «w1D» parameter to [[SingularValueDecomp]]. When false or omitted, it the resulting W is a square diagonal matrix. When set to true, the returned W is a vector (the diagonal).&lt;br /&gt;
&lt;br /&gt;
* Added an optional «except» parameter to [[IndexesOf]], which accepts any number of index identifiers. For example, the following sums over every index of array A  except for &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.&lt;br /&gt;
:::&amp;lt;code&amp;gt;[[Sum]]( A, …[[IndexesOf]](A, except:I,J) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Added a «first» parameter to [[ArgMin]], [[Argmax]], [[SubIndex]], and [[PositionInIndex]]. When omitted or false, in the event of a tie these return the ''last'' occurrence. When set to true, they return the position of the first occurrence of the tie.&lt;br /&gt;
&lt;br /&gt;
::In addition, it was previously less obvious which tie was identified by [[ArgMin]] or [[Argmax]] in the multi-dimensional case. Now it is the first or last occurrence in the natural ordering of the supplied index parameters.&lt;br /&gt;
&lt;br /&gt;
* The basis index, &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;, is now optional for the [[Regression]] function. This is for convenience when performing a 1-D regression over a scalar x.&lt;br /&gt;
&lt;br /&gt;
* Added an optional «measureOnly» boolean parameter to [[CanvasDrawText]]. &lt;br /&gt;
&lt;br /&gt;
==== For sparse arrays ====&lt;br /&gt;
* Added an optional boolean parameter «sparse» to [[MdTable]]. Experimental. See [[#Sparse arrays]].&lt;br /&gt;
* The optional Boolean «sparseCount» parameter to [[Size]]. When true, counts the actual number of values (including default values) in the sparse array.&lt;br /&gt;
&lt;br /&gt;
=== Analytic distribution functions ===&lt;br /&gt;
The analytic probability functions for all built-in distributions are now also built-in functions. For example, corresponding to the [[Triangular]] distribution function there are also the [[DensTriangular]], [[CumTriangular]] and [[CumTriangularInv]] functions. Previously, to use these functions you have to add the [[Distribution Densities Library]] to your model.&lt;br /&gt;
&lt;br /&gt;
The general naming pattern for these functions is (where «dist» is the name of the distribution):&lt;br /&gt;
* &amp;lt;code&amp;gt;Dens«dist»&amp;lt;/code&amp;gt;: The ''probability density function'' for a continuous distribution. Returns the density at «x».&lt;br /&gt;
* &amp;lt;code&amp;gt;Prob«dist»&amp;lt;/code&amp;gt;: The ''discrete probability function'' for a discrete distribution. Returns the probability of «x».&lt;br /&gt;
* &amp;lt;code&amp;gt;Cum«dist»&amp;lt;/code&amp;gt;: The cumulative probability function, also known as the ''probability function'' and ''cumulative density function''. Returns the probability of being less than or equal to «x».&lt;br /&gt;
*&amp;lt;code&amp;gt;Cum«dist»Inv&amp;lt;/code&amp;gt;: The inverse cumulative probability function, also called the ''quantile function''. Returns the «p»th fractile/percentile/quartile.&lt;br /&gt;
&lt;br /&gt;
A few of these analytic functions were already built in previously, but all of the following were added:&lt;br /&gt;
* [[DensBeta]], [[DensChiSquared]], [[DensCumDist]], [[DensExponential]], [[DensFDist]], [[DensGamma]], [[DensLogistic]], [[DensProbDist]], [[DensStudentT]], [[DensTriangular]], [[DensWeibull]].&lt;br /&gt;
* [[ProbBernoulli]], [[ProbBinomial]], [[ProbGeometric]], [[ProbHyperGeometric]], [[ProbNegativeBinomial]], [[ProbPoisson]], [[ProbUniform]]&lt;br /&gt;
* [[CumBernoulli]], [[CumBeta]], [[CumChiSquared]], [[CumCumDist]], [[CumExponential]], [[CumFDist]], [[CumGamma]], [[CumGeometric]], [[CumHyperGeometric]], [[CumLogistic]], [[CumNegativeBinomial]], [[CumProbDist]], [[CumStudentT]], [[CumTriangular]], [[CumUniform]], [[CumWeibull]].&lt;br /&gt;
* [[CumBernoulliInv]], [[CumBetaInv]], [[CumChiSquaredInv]], [[CumCumDistInv]], [[CumExponentialInv]], [[CumFDistInv]], [[CumGammaInv]], [[CumGeometricInv]], [[CumHyperGeometricInv]], [[CumLogisticInv]], [[CumNegativeBinomInv]], [[CumProbDistInv]], [[CumStudentTInv]], [[CumTriangularInv]], [[CumUniformInv]], [[CumWeibullInv]].&lt;br /&gt;
&lt;br /&gt;
=== New built-in functions ===&lt;br /&gt;
* The preceding section covered the many newly built-in analytic distribution functions.&lt;br /&gt;
&lt;br /&gt;
* The [[F-distribution]] was added as a built-in function (functions [[FDist]], [[DensFDist]], [[CumFDist]] and [[CumFDistInv]]).&lt;br /&gt;
&lt;br /&gt;
* [[ParseExpression]]: Returns a parse tree for an Analytica expression. When this is assigned to a global variable, the edit table cells are Analytica expressions. &lt;br /&gt;
&lt;br /&gt;
* [[MultiResult]](..) and [[MultiResult|_]](…) return multiple values. See [[#Returning multiple values from a UDF]].&lt;br /&gt;
&lt;br /&gt;
* [[ChangeArraySparsity]]: (experimental) converts between a sparse and standard multi-dimensional array representation.&lt;br /&gt;
&lt;br /&gt;
* [[GraphToCanvasCoord]]: For use in the [[OnGraphDraw]] expression, it maps from a data value to a pixel coordinate. See [[#OnGraphDraw]] on this page.&lt;br /&gt;
&lt;br /&gt;
* [[MantissaAndExponent]](x): Returns the mantissa and base-2 exponent of a floating point number.&lt;br /&gt;
&lt;br /&gt;
=== Enhancements to existing functions ===&lt;br /&gt;
* [[MakeJSON]] handles the encoding of multidimensional arrays better, with better control over nesting orders and ability to map some indexes to JSON objects and others to JSON arrays.&lt;br /&gt;
* Added the «except» parameter to the [[IndexesOf]] function.&lt;br /&gt;
* Added the «first» parameter to [[SubIndex]], [[ArgMin]], [[ArgMax]], [[SubIndex]] and [[PositionInIndex]]&lt;br /&gt;
* [[CellOnClick]] allows local variables in expression and supplies several new local variables to the expression. See below.&lt;br /&gt;
* When the probabilities in a [[ProbTable]] don't add to 1, the [[Mid]]-value is now determined from the normalized version, and hence may differ from the mid-value in pre-5.2 releases. The [[Sample]]-value is unaffected, since it was already determined from the normalized probabilities.&lt;br /&gt;
* Optional parameters added to [[MsgBox]] allow you to include one or two URL links and a checkbox input on the dialog.&lt;br /&gt;
* An optional parameter «getFrom» was added to [[NumberToText]]. Specify a handle to use the stored number format from an indicated object.&lt;br /&gt;
&lt;br /&gt;
=== New System Variables ===&lt;br /&gt;
The following system variables are new:&lt;br /&gt;
* [[DisableMultithreaded]]&lt;br /&gt;
* [[EnableSparse]]&lt;br /&gt;
* [[UserGoogleAPIKey]]&lt;br /&gt;
&lt;br /&gt;
== Libraries and Example Models ==&lt;br /&gt;
* New library (for [[Analytica Enterprise]] users): &amp;quot;Google Maps from OnGraphDraw&amp;quot;. Makes it easy to plot data over a Google Map via the new [[OnGraphDraw]] attribute.&lt;br /&gt;
* New example model (for [[Analytica Enterprise]] users): &amp;quot;CSV read and Google Maps plot.ana&amp;quot;, in the Data Analysis folder. Shows how to use the Google Maps plotting, how to download CSV data from a web source with fail-over to a second URL source if the first fails, and how to parse the CSV file.&lt;br /&gt;
&lt;br /&gt;
== File saving and loading ==&lt;br /&gt;
* The save author and save date are no longer written as part of the model file. These were inconvenient when tracking a model in a source control system (like git or svn) because they changed every time, and collided every time when merges were required. When a model file is read that does not have the save date, the SaveDate attribute is now set to the file system's last-modified time stamp.&lt;br /&gt;
&lt;br /&gt;
== Cell Formats ==&lt;br /&gt;
=== CellOnClick ===&lt;br /&gt;
* The «expr» inside a [[CellOnClick]] now has access to the coordinates of the cell that was clicked. From «expr», evaluating any of the index identifiers in a value context returns the coordinate of that index at the clicked cell. &lt;br /&gt;
* All the special local variables available in the [[Cell Format Expression]] attribute in general are now available inside «expr» when it is run, plus two more locals can be used: &lt;br /&gt;
** &amp;lt;code&amp;gt;TotalIndexes&amp;lt;/code&amp;gt;: A list of handles containing all indexes that are being summed over for the clicked cell.&lt;br /&gt;
** &amp;lt;code&amp;gt;comparisonColumn&amp;lt;/code&amp;gt;: When a cell is in a comparison variable column of a result table, this is the exogenous comparison variable or expression (i.e., it is either a [[handle]] or a parsed expression). If the click was not in a comparison column (the more normal case), this is null. &lt;br /&gt;
* Assignment can now occur directly from inside the «expr» of [[CellOnClick]]. Previously, you had to do it from a [[UDF]].&lt;br /&gt;
* When a cell contains a [[handle]] or [[reference]], the default behavior is to hyperlink when the user double clicks. But a [[CellOnClick]] handler overrides that. Now if the [[CellOnClick]] returns false (0), the default behavior will (also) execute.&lt;br /&gt;
&lt;br /&gt;
== Clipboard ==&lt;br /&gt;
* Paste XML Spreadsheet format&lt;br /&gt;
** Copy/paste from Excel to Analytica or from Analytica to Excel is as faithful as possible to data types and what you see is what you get&lt;br /&gt;
** Copy/paste from one instance of Analytica to another instance is similarly faithful&lt;br /&gt;
** Paste special offers XML Spreadsheet format as the default option&lt;br /&gt;
** Paste special unlinked supports user choice of clipboard format used&lt;br /&gt;
** XML Spreadsheet format offers special support for row headers and column headers on copy/paste from Analytica to Analytica&lt;br /&gt;
* The Paste menu option is enabled in browse mode when the focus could be pasted to if only you changed to edit mode. When you attempt a paste or Ctrl+V, it then asks you if you want to change to edit mode. Address a confusing &amp;quot;why isn't paste working?&amp;quot; case, where you forgot you are in browse mode.&lt;br /&gt;
&lt;br /&gt;
== General GUI ==&lt;br /&gt;
* Several enhancements to the [[Indexes dialog]] make it easier to select indexes when the list is very long.&lt;br /&gt;
** The dialog is larger, so indexes more are visible in the panes.&lt;br /&gt;
** You can now view index identifiers by pressing Ctrl+Y&lt;br /&gt;
** You can type the first few characters to quickly jump to the index that starts with those characters.&lt;br /&gt;
** The Up, Down, Page Up, and Page Down keyboard can be used to scroll the index pane.&lt;br /&gt;
** The Left or Right keys can be used to move the selected index or indexes from one pane to the other (same as pressing the &amp;gt;&amp;gt; or &amp;lt;&amp;lt; button).&lt;br /&gt;
** Use the mouse wheel to scroll the Indexes pane.&lt;br /&gt;
* More recent files recorded by default (was 6. Now 11).&lt;br /&gt;
* Added the '''Remove quotes''' option for lists&lt;br /&gt;
* Added the '''Remove quotes''' and '''Add quotes''' dropdown menu options for description and definition fields in object windows&lt;br /&gt;
** These operations support undo and redo&lt;br /&gt;
** These operations are performed in the selected area in these input windows only&lt;br /&gt;
** '''Add quotes''' is useful for the definition field when a paste operation puts data there that is meant to be a string but does not initially have quotes, escaping internal quotes as part of the operation&lt;br /&gt;
* '''Comparison Tolerance''' appears on the Definition menu. &lt;br /&gt;
* Undo for&lt;br /&gt;
** Uncertainty options... changes&lt;br /&gt;
* The preferred declaration constructs (e.g., Local..Do) appear on Definition menu, and not deprecated ones (e.g., Var..Do).&lt;br /&gt;
* When you exceed the number of characters allowed in the identifier or units field, it now displays the error in a bubble instead of a primitive model alert dialog.&lt;br /&gt;
::[[image:too_many_characters_bubble.png]]&lt;br /&gt;
&lt;br /&gt;
== Optimizer ==&lt;br /&gt;
* The add-on OptQuest engine is now available from Analytica 64-bit. Previously this engine was only available in 32-bits.&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
* Some pages of the wiki have a release bar at the top and display different content depending on which release number is selected. The release bar looks like this:&lt;br /&gt;
*::{{ReleaseBar}}&lt;br /&gt;
*:Links from Analytica into the wiki now include the release number in the URL, so that the Wiki can automatically select the same release number that you are using. Since this is new to 5.2, release 4.6, 5.0 or 5.1 won't auto-select the release, but it will enable future releases to show the correct version-specific pages. &lt;br /&gt;
&lt;br /&gt;
== ADE ==&lt;br /&gt;
* Changed the [[CATable::GraphWithStoredPivot]] property to default to true.&lt;br /&gt;
* Method for installation of ADE without running installer. Used to create a docker container image.&lt;br /&gt;
* The binary for AdeTest is now compiled for .NET 4.6.  The project file is saved for Visual Studio 2018.&lt;br /&gt;
&lt;br /&gt;
== Retired 32-bit ==&lt;br /&gt;
Analytica 5.2 is being released only in 64-bit. The 32-bit edition has been retired.&lt;br /&gt;
&lt;br /&gt;
== Licensing ==&lt;br /&gt;
* Fixed a bug where RLM Server name didn't stick in licensing dialog. This caused problems for users of floating licenses and required them to manually set a registry setting to get around it.&lt;br /&gt;
* Changed beta-build licensing. Formerly a separate beta testing license was required. Now any active subscription license (i.e., expiring 5.x license) is sufficient. Thus, we eliminated lots of complex code for automatically acquiring and updating beta test licenses during the beta testing period.&lt;br /&gt;
&lt;br /&gt;
== Typescript ==&lt;br /&gt;
* The Up and Down arrow keys recall history, like Ctrl+Up and Ctrl+Down already do.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_5.2%3F&amp;diff=61839</id>
		<title>What's new in Analytica 5.2?</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_5.2%3F&amp;diff=61839"/>
		<updated>2024-11-22T02:28:21Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Multiple return values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:What's new pages]]&lt;br /&gt;
&amp;lt;!--The current release is [[Analytica 5.1]]. Analytica 5.2 is currently in beta testing. If you have an Analytica subscription, we invite you to become beta tester of Analytica 5.2. Visit the [[Beta Tester Page]] for details.&lt;br /&gt;
&lt;br /&gt;
As usual with a new release, Analytica 5.2 includes many improvements and bug fixes. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
For most users, the most valuable new features are about graphing:&lt;br /&gt;
&lt;br /&gt;
* '''Zoom into graphs''': Press your mouse button within a graph and drag the cursor to show a rectangle to get a close up view of that part of the graph. You can do this horizontally to zoom into part of the X axis, vertically to zoom the Y axis, or both together. &lt;br /&gt;
&lt;br /&gt;
* '''Hide elements on a graph:''' Further enhances on a popular feature introduced in [[Analytica 5.1]] that gives you the option to hide some lines on a graph. Click an element in the key to toggle whether to hide or show the corresponding line.  If there are many key items, and you want to show just one or a few, you can now  select '''Turn off all key items''' from the right-click menu in the Key. Then you can click just those few key items you want to show. &lt;br /&gt;
&lt;br /&gt;
* '''Combine symbols and lines:'''  You can show some data sets as symbols and others as a continuous line in the same graph -- for example, to show a regression line fitted to data points. In '''Graph setup''' / '''Chart type''', select the second '''Line style''' which shows lines ''and'' symbols. In the Graph, you can now click each element in the Key to display line only, symbol only, both line and symbol, or neither (to hide that data) by successive clicks.  To save these options for future views of the graph, select '''Save key item visibility''' from the '''right-click menu'''.&lt;br /&gt;
:::[[File:Graph setup dialog with Line style lines and symbols.png|200px]] &lt;br /&gt;
&lt;br /&gt;
* '''Show and fill regions on a map:'''  Given a series of points with longitude and latitude, you can show them as regions. You should select the longitude and latitude values as X and Y values using [[XY Comparison|XY]] plot. The  '''Graph setup''' / '''Chart type''' then shows a new '''Fill type''' option, which lets you fill in each polygon with a color.&lt;br /&gt;
&lt;br /&gt;
* '''OnGraphDraw attribute:''' Lets you draw points, lines, areas, and text on a graph to annotate it, for example to point out a maximum, minimum value, add labels to points, or even show points on a Google map.  &lt;br /&gt;
&lt;br /&gt;
* '''Multiple results from a function:''' A function can now return multiple results of different dimensions.  You can assign multiple results to multiple local variables, for example:&lt;br /&gt;
:&amp;lt;code&amp;gt;Local (txt, filename) :=  ReadTextFile('Import file.txt', Dialog: True);&amp;lt;/code&amp;gt;&lt;br /&gt;
[[ReadTextFile]] now returns the file name as its second result in addition to the actual text contents of the file as its first result. This is useful if the user may select a different file from the default on specified as first parameter. Several other built-in functions that access files also now return the file name as a second result. You can also define user defined functions to return multiple results, using this construct, usually as the last expression in its definition:&lt;br /&gt;
:::&amp;lt;code&amp;gt;[[MultiResult]]( v1, v2, v3)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Extended syntax for locals and assignment:'''  As shown above, you can declare multiple local variables at once. You can also assign to multiple local variables outside a declaration:&lt;br /&gt;
:::&amp;lt;code&amp;gt;(txt, filename) :=  ReadTextFile('Import file.txt', Dialog: True);&amp;lt;/code&amp;gt;&lt;br /&gt;
You can declare multiple locals together as:&lt;br /&gt;
:::&amp;lt;code&amp;gt;Local x := 1, y := 2, z := 3;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See below for more on these and other new features.&lt;br /&gt;
&lt;br /&gt;
___TOC___&lt;br /&gt;
&lt;br /&gt;
== Graphing ==&lt;br /&gt;
&lt;br /&gt;
=== Interactive zooming ===&lt;br /&gt;
&lt;br /&gt;
When you first show a result as a graph, it automatically set the ranges for the vertical and horizontal axes so that all data points are visible (ignoring values containing [[INF, NAN, and NULL - Exception values|INF, NAN, or Null]]).  Now, you can zoom in to show just part of the graph by dragging the cursor.  Drag the cursor horizontally from a low to high value to zoom in along the horizontal axis. Drag it vertically to zoom along the vertical axis. Drag it diagonally to create a rectangle to zoom in on both axes. It records the zoomed min and max values in the Axis ranges tab of Graph setup as if you had set them manually.&lt;br /&gt;
&lt;br /&gt;
* Drag the mouse horizontally to zoom to a manually-scaled x-axis interval:&lt;br /&gt;
::[[image:graph_zoom_horiz.png]] &amp;amp;rarr; [[image:graph_zoom_horiz_after.png]]&lt;br /&gt;
::Transparent blue selection rectangle appears while dragging. After drag, Y is still autoscaled, but now to the data in the selected range.&lt;br /&gt;
* Drag the mouse diagonally to zoom to manually-scaled intervals on both axes:&lt;br /&gt;
::[[image:graph_zoom_diag.png]] &amp;amp;rarr; [[image:graph_zoom_diag_after.png]]&lt;br /&gt;
* When you move the mouse over a zoomed graph, autoscale hover icon buttons appear. Click on one to auto-scale that axis.&lt;br /&gt;
::[[image:graph_zoom_autoscale.png]] &amp;amp;rarr; [[image:graph_zoom_autoscaley_after.png]]&lt;br /&gt;
::Clicked on the vertical axis autoscale hover icon. Horizontal axis is still manually scaled.&lt;br /&gt;
* Drag vertically to zoom to a manually-scaled y-axis interval.&lt;br /&gt;
::[[image:graph_zoom_vert.png]] &amp;amp;rarr; [[image:graph_zoom_vert_after.png]]&lt;br /&gt;
* Zooming has the same effect as changing the manual scale range in Graph Setup. In fact, it records your selected end points there.&lt;br /&gt;
::[[image:graph_zoom_graphsetup_after.png]]&lt;br /&gt;
&lt;br /&gt;
=== Key item visibility states ===&lt;br /&gt;
&lt;br /&gt;
Analytica 5.2 further enhances the popular feature (introduced in [[Analytica 5.1]]) that lets you click on each item in Graph Key to show or hide the corresponding line or bar. See [[Toggling Key Item Visibility]].&lt;br /&gt;
&lt;br /&gt;
==== Turn on all, Turn off all ====&lt;br /&gt;
&lt;br /&gt;
Right-click on a graph Key to see menu options '''Turn on all key items''' and '''Turn off all key items'''. Use these when you want to show or hide almost all of them. They save you many clicks when there are a lot of key items.&lt;br /&gt;
&lt;br /&gt;
==== Show lines and symbols  ====&lt;br /&gt;
&lt;br /&gt;
You can now show a graph with some data as symbols only, some as lines without symbols, and some lines and symbols.  This is very useful when you want to show data points and a line fitted to those points on the same graph.&lt;br /&gt;
::[[image:Line and point graph.png]]&lt;br /&gt;
&lt;br /&gt;
To achieve this, select the Line+Symbol plot style:&lt;br /&gt;
:[[image:How to line and point graph.png]]&lt;br /&gt;
Initially, every data series (key item) has lines and symbols (as before).  Click on each Key item to toggle it from line+symbol to line-only to symbol-only, and back to line+symbol. So with just a few clicks, you can select how to display each each series.&lt;br /&gt;
&lt;br /&gt;
What if your graph has multiple keys, line and symbol or symbol size each depicting different information?  You can then toggle each element on each key separately through three states: On to Off to Partial, and back to On. In the Off state, it hides both lines and symbols. In the Partial state on the Line key, it hides the line but shows the symbols.  Or in the Symbol Key, when an item is Partial, it shows the line but not the symbol.  &lt;br /&gt;
&lt;br /&gt;
::[[image:graph_key_symbol_partial.png]]&lt;br /&gt;
&lt;br /&gt;
In the above graph, the 2 points corresponding to '''Least''' would appear at x=2 in the fully-on graph, but fit_err=Least is been clicked once, putting it into the off state. As a result, there is a gap in the lines at x=2. In the symbol size key (x cat), the x_cat=8 item is in the partial state. The points corresponding to x_cat=8 appear at x=8. In this case the lines pass through the points, but the symbols are hidden. &lt;br /&gt;
&lt;br /&gt;
When fit_graph=y in the line key is off, all the red &amp;quot;ink&amp;quot; on the graph disappears. But when it is in the partial state, the line disappears but the symbols continue to show, as illustrated here:&lt;br /&gt;
::[[image:graph_key_line_partial.png]]&lt;br /&gt;
&lt;br /&gt;
==== Save visibility states ====&lt;br /&gt;
Changes to key item visibility reset by default when you close and re-open a graph anew. If you want your current visibility state to be saved as the starting point next time the graph is opened, select '''Save key item visibilities''' from the right-mouse menu.&lt;br /&gt;
&lt;br /&gt;
=== Polygon fill plots ===&lt;br /&gt;
When you plot a curve in an X-Y plot, there is now a polygon fill option that fills the interior of the polygon(s). For example, starting with this data, already plotted as Latitude vs Longitude&lt;br /&gt;
::[[image:California_unfilled_plot.png]]&lt;br /&gt;
you can use the new Polygon fill type (the Fill type option is new).&lt;br /&gt;
::[[image:Graph_setup_polygon_filltype.png]]&lt;br /&gt;
The difference between alternate and solid arises when a curve crosses itself. In this example with a state outline, that doesn't happen so they are equivalent.  Polygon fill closes each curve segment (null data starts a new segment) and fills the interior.&lt;br /&gt;
::[[image:California_filled_plot.png]]&lt;br /&gt;
and viola!&lt;br /&gt;
::[[image:Red state blue state.png]]&lt;br /&gt;
&lt;br /&gt;
=== OnGraphDraw ===&lt;br /&gt;
You can use the [[OnGraphDraw]] attribute to adorn or customize your graphs in various ways. You can enter an expression that gets evaluated at any of 4 phases during the graph rendering. A [[Canvas]] is provided that you can draw on using the [[Drawing images|canvas drawing functions]]. &lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
Using [[OnGraphDraw]], by drawing on the canvas ''after'' the graph has been rendered, you you can annotate points on a plot such as the maximum or minimum, label a threshold level, draw error bars or labels for individual points.&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw min and max.png]]&lt;br /&gt;
[[image:OnGraphDraw threshold.png|400px]]&lt;br /&gt;
[[image:OnGraphDraw_ErrorBars.png|400px]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By drawing ''after'' the axes have been scaled, but before the data has been plotted, you can draw under the data, or replace the rendering of the data entirely, such as by replacing probability bands with Tukey bars that your code renders.&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw_TukeyBands.png|400px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also draw a Google map under the data (Analytica Enterprise is required to support the functions necessary for downloading a Google map).&lt;br /&gt;
&amp;lt;center&amp;gt;[[image:OnGraphDraw map.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
The Google map also requires running the [[OnGraphDraw]] after the graph is laid out, but before the axes are drawn, at which opportunity it can register the actual latitute/longitude axis scale to match the downloaded map.&lt;br /&gt;
&lt;br /&gt;
Finally, you can draw ''before'' anything has been drawn to completely replace the graph with a totally customized data depiction, such as a pie chart, dendritic tree, etc.&lt;br /&gt;
&lt;br /&gt;
==== Using OnGraphDraw ====&lt;br /&gt;
* To use OnGraphDraw, go to the [[Attributes dialog]] and enable it for Variables. It appears there now.&lt;br /&gt;
* On the [[Object window]] for the variable on interest, the [[OnGraphDraw]] attribute appears, along with a series of check box where you can select which phases of drawing you want your code called. &lt;br /&gt;
* Several local variables are provided to [[OnGraphDraw]]: &amp;lt;code&amp;gt;canv&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;phase&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt;. These supply the canvas, information about the graph itself and its layout, the pivot (roles) of the graph, and which phase of rendering is being processed. You can set &amp;lt;code&amp;gt;continue&amp;lt;/code&amp;gt; to tell it not to draw further, or set &amp;lt;code&amp;gt;roleChanges&amp;lt;/code&amp;gt; to make actual changes (like when registering actual latitude bounds of a Google map).&lt;br /&gt;
* The new [[GraphToCanvasCoord]] function makes it easy to find the pixel location for a data point, based on the data's own units.&lt;br /&gt;
&lt;br /&gt;
See [[OnGraphDraw]] for instructions on how to use this.&lt;br /&gt;
&lt;br /&gt;
Specific adornments or novel plot types can be encapsulated as [[User-Defined Functions]] and bundled in libraries, so that with these you need only add a function call in [[OnGraphDraw]] and check the appropriate phase check boxes. We have not released any such library yet, but may post libraries like this on the Analytica Wiki and Analytica blog in the future, so stay tuned.&lt;br /&gt;
&lt;br /&gt;
=== Other graphing ===&lt;br /&gt;
&lt;br /&gt;
* Bug fix impacting marginal abatement graphs&lt;br /&gt;
* Changing symbol size role less likely to swap other roles, less confusing&lt;br /&gt;
&lt;br /&gt;
== Expression language &amp;amp; Engine ==&lt;br /&gt;
&lt;br /&gt;
=== Declaring local identifiers ===&lt;br /&gt;
&lt;br /&gt;
==== Omission of initial value====&lt;br /&gt;
&lt;br /&gt;
When declaring a local, you can now omit its initial value, so that &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x;&amp;lt;/code&amp;gt;&lt;br /&gt;
is equivalent to &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x := Null&amp;lt;/code&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
==== Multiple locals in one declaration ====&lt;br /&gt;
&lt;br /&gt;
You can declare multiple local identifiers in the same Local declaration. For example,&lt;br /&gt;
:&amp;lt;code&amp;gt;Local a, b := 5, c[ J ], d[ ] := Va1;&amp;lt;/code&amp;gt;&lt;br /&gt;
This is then equivalent to four separate declarations as follows&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[Local]] a:=[[Null]];&lt;br /&gt;
:[[Local]] b:=5;&lt;br /&gt;
:[[Local]] c[ J ] := [[Null]];&lt;br /&gt;
:[[Local]] d[ ] := Va1;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Capture of multiple return values ====&lt;br /&gt;
&lt;br /&gt;
Functions can now return multiple values, each with different dimensionality. This is covered below in [[#Multiple return values]]. These values can be captured by [[Local]] (or the other declaration constructs like [[For]], etc.) by placing the declared identifiers inside parentheses, as illustrated here:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (u,w,v) := [[SingularValueDecomp]]( a, I, J, J2 );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the function, [[SingularValueDecomp]] returns three matrices, each with a different dimensionality. With dimensional restrictions, this could also be declared as&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (u[I,J], w[J,J2], v[J,J2]) := [[SingularValueDecomp]]( a, I, J, J2 );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that [[SingularValueDecomp]] is called a single time, and returns three separate values. This function, as well as [[EigenDecomp]], behave differently when multiple return values are captured compared to when only the main value is used, which is done for backward compatibility with their legacy behavior. Previously, the returned a data structure with 3 [[references]] to the 3 matricies, which required some work to unpack. They illustrate that the capability to return multiple values isn't entirely new, but is far more convenient. These two functions are the only functions that change their behavior. For all other functions, when only the main value is used, the secondary return values are simply dropped (and are usually not computed in the first place). For example, in addition to reading the contents of a file, you can also capture the file name selected by the user using&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( txt, filename ) := [[ReadTextFile]](&amp;quot;&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but you don't need to capture filename if you don't need it, and can simple use&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] txt := [[ReadTextFile]](&amp;quot;&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Reduced keyword ====&lt;br /&gt;
&lt;br /&gt;
As with previous releases, you can declare the indexes that the value named by a local identifier is allowed to have using brackets, such as &lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] x[I, J, K] := Z;&amp;lt;/code&amp;gt;&lt;br /&gt;
When declared in this fashion, and expressions you include in the body (i.e., the lexical scope of these local identifiers) can be treated as if it does not contain any indexes not listed. The new keyword &amp;quot;&amp;lt;code&amp;gt;reduced&amp;lt;/code&amp;gt;&amp;quot; also restricts the dimensionality of a local variable, but in a somewhat different way. The same qualifier exists for [[Function parameter qualifiers|function parameter declarations]] and in fact works in exactly the same way here.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] ( a[ ], b reduced ) := _( X, Y );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; might need to be iterated over the indexes of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; will have the indexes of &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; that are not also indexes of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;. In addition, the slice of X or Y named by a or b is coordinated. When a names &amp;lt;code&amp;gt;X[J=3]&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; also names &amp;lt;code&amp;gt;Y[J=3]&amp;lt;/code&amp;gt;.  This leads to some convenient new iteration constructs. For example, you may have seen expressions such as this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] n := @I Do (&lt;br /&gt;
::[[Local]] ii := I[@I=n]&lt;br /&gt;
::[[Local]] x_i := X[@I=n];&lt;br /&gt;
::…&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the ensuing looped body code makes use of the index position (n), the index label (ii), and the array slice (x_i), and so it has to extract two of the items from the loop variable. This can now be condensed to a single looping structure,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] (n[], ii[], x_i reduced) := _(@I, I, X) Do ( …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: In many cases, the word [[Local]] can be used in place of [[For]] here. Note that &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; names each position of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ii&amp;lt;/code&amp;gt; names each label of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;x_i&amp;lt;/code&amp;gt; names the slice of &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; corresponding to &amp;lt;code&amp;gt;[@I=n]&amp;lt;/code&amp;gt;. This is similar to calling a function with &amp;lt;code&amp;gt;F(@I, I, X)&amp;lt;/code&amp;gt; with has Parameters declared as &lt;br /&gt;
:Function F(n,i : [] ; x_i : reduced)&lt;br /&gt;
&lt;br /&gt;
==== Iterating over repeated parameters (Local xi := repeated x Do) ====&lt;br /&gt;
&lt;br /&gt;
When a [[User-Defined Function]] has a repeated parameter, for example when its [[Parameters]] are:&lt;br /&gt;
:&amp;lt;code&amp;gt;( x : ... )&amp;lt;/code&amp;gt;&lt;br /&gt;
or equivalently&lt;br /&gt;
:&amp;lt;code&amp;gt;(x : repeated)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the &amp;quot;correct&amp;quot; way to iterate over the supplied parameters in the Definition of the UDF is now&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] xi := repeated x;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;repeated&amp;lt;/code&amp;gt; keyword at this position is recognized. So for example, if someone calls this function as&lt;br /&gt;
:&amp;lt;code&amp;gt;F(a,b,c)&amp;lt;/code&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; each have different dimensions, &amp;lt;code&amp;gt;xi&amp;lt;/code&amp;gt; will alias each of these values in turn. A couple syntactic variations are to use [[For]] in place of [[Local]], or to include parens around the name, e.g.,&lt;br /&gt;
:&amp;lt;code&amp;gt;[[For]] xi := repeated(x) Do ...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, you can also access these using, e.g., Slice(x,2) for the second repeated. It is best, however, not to treat the repeated &amp;quot;dimension&amp;quot; as you would the implicit dimension, otherwise you may end up with the union of the incoming dimensions.&lt;br /&gt;
&lt;br /&gt;
==== Preservation of local name instead of local1, local2 ====&lt;br /&gt;
&lt;br /&gt;
Prior to this release, the parse tree (an internal data structure) for an Analytica expression did not remember the local identifier. Instead, it numbered the locals, and so every once in a while you might encounter a situation where the identify of the local is extracted from the parse tree and appears as &amp;lt;code&amp;gt;local1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;local2&amp;lt;/code&amp;gt;, etc.  Analytica 5.2 now annotates the parse tree with the local identifier, so that depictions of the parse use the original names. For example, suppose &amp;lt;code&amp;gt;Va1&amp;lt;/code&amp;gt; is defined as&lt;br /&gt;
&lt;br /&gt;
 [[Local]] x := [[Sin]](angle);&lt;br /&gt;
 [[Local]] y := [[Cos]](angle);&lt;br /&gt;
 [x,y]&lt;br /&gt;
&lt;br /&gt;
You can see the difference here:&lt;br /&gt;
{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
|[[Image:LocalIdentsIn5.1.png]] || [[Image:LocalIdentsIn5.2.png]] &lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;center&amp;gt;In Analytica 5.1&amp;lt;/center&amp;gt; !! &amp;lt;center&amp;gt;In Analytica 5.2&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Multiple return values ===&lt;br /&gt;
&lt;br /&gt;
Functions can now return multiple values, each with potentially different indexes, not just a single value or array, as previously.  An expression calling the function may use only the first returned value, or it can use some or all of the values.  Several built-in functions return extra information in the second and third return values.&lt;br /&gt;
&lt;br /&gt;
==== Built-in functions that return multiple values ====&lt;br /&gt;
&lt;br /&gt;
These built-in functions read information from a file and return its contents in one way or other in the main value. Each has now been enhanced to return the file name that was opened as a second parameter. Since in each case, a user might potentially select a file from a file selector dialog, you would otherwise not knowing which file was actually read.  The primary return value is the same as in previous releases, the second return value is new.&lt;br /&gt;
&lt;br /&gt;
* [[ReadTextFile]]: Returns ( file_contents, filename )&lt;br /&gt;
* [[SpreadsheetOpen]]: Returns ( workbook, filename )&lt;br /&gt;
* [[ReadExportFile]]: Returns ( array, filename )&lt;br /&gt;
* [[ReadBinaryFile]]: Returns (date, filename)&lt;br /&gt;
* [[ReadImageFile]]: Returns (image, filename)&lt;br /&gt;
&lt;br /&gt;
Note: the Write functions don't yet return filenames in this fashion. &lt;br /&gt;
&lt;br /&gt;
* [[CanvasDrawText]] returns the coordinates of the bounding box of the text.&lt;br /&gt;
* [[Regression]] will return the bias coefficient as a second return value without having it included in the basis.&lt;br /&gt;
* [[MantissaAndExponent]] returns the mantissa and exponents as separate return values.&lt;br /&gt;
* [[MsgBox]] returns the check box state as a second return value.&lt;br /&gt;
&lt;br /&gt;
The function [[SingularValueDecomp]] computes three matrices, each with a different dimensionality. Formerly, these were returned as a vector of 3 [[reference]]s. You would then usually unpack this, extracting the three items. With the ability for it to return three return values, the call is more convenient, namely:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;(u, w, v) := [[SingularValueDecomp]]( a, I, J, J2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
eliminating the ugly unpacking code. To ensure backward compatibility with code that used the 3-reference data structure, it is able to detect when you are capturing multiple return values and return the 3-reference structure when you are not.  &lt;br /&gt;
&lt;br /&gt;
A similar enhancement applies to the [[EigenDecomp]] function, which returns a vector of eigen values and 2-D matrix of eigen vectors. Formerly, these were bundled using a reference for the eigen vectors, but with multiple return values it is convenient to immediately separate these, e.g.,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;(eigenVals, eigenVecs) := [[EigenDecomp]](a, I, J)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[EigenDecomp]] also retains its legacy behavior when you are not capturing multiple return values.&lt;br /&gt;
&lt;br /&gt;
The [[Regression]] function automatically adds a bias term to the basis and return the bias coefficient as the second return value when you capture the second return value. This means you can now find &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; for simple y=m*x+b regression for scalar x using just&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (m,b) := [[Regression]](y, x, I);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can include a checkbox on a message box displayed by [[MsgBox]](). When you do so, the state of the checkbox is returned as a second return value.&lt;br /&gt;
&lt;br /&gt;
==== Capturing multiple return values ====&lt;br /&gt;
When a function returns multiple return values, you have to capture these values. There are two ways of doing this: In a local declaration, or via the assignment operator (:=).&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]]( x, y, z ) := FuncWithMultiple(  );&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
:&amp;lt;code&amp;gt;(a, b, c) := FuncWithMultiple( );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When assignment is used, each destination (a, b and c) can be anything that could appear on the left-hand side of an normal assignment operator. This includes local identifiers, global variables (in contexts where a side-effect is legal), a slice of a local variable, an attribute of an object, etc. &lt;br /&gt;
&lt;br /&gt;
Although I'm showing the local declaration example using [[Local..Do]], you can also use other local declaration constructs in the same way, including [[For]] and [[LocalAlias]], or the legacy [[Var..Do]], [[Using..Do]], [[MetaVar..Do]], etc. &lt;br /&gt;
&lt;br /&gt;
When you capture a return value that isn't actually returned by the function, it is equivalent to capturing null. For example:&lt;br /&gt;
:&amp;lt;code&amp;gt;( x,y ) := [[Sqrt]](5)&amp;lt;/code&amp;gt;&lt;br /&gt;
sets &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; to 5 and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; to null.&lt;br /&gt;
&lt;br /&gt;
==== Returning multiple values from a UDF ====&lt;br /&gt;
To return multiple values from your own UDFs, simple return &lt;br /&gt;
:&amp;lt;code&amp;gt;[[MultiResult]]( v1, v2, v3, v4 )&amp;lt;/code&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;v1, v2, …&amp;lt;/code&amp;gt; are the expressions whose result is to be returned. Be aware that for any of these values that are not captured by the caller, the corresponding expression will not be evaluated. You can use that to your advantage by placing any time-consuming code not shared by v1 in the expression for v2, so that when the caller uses only v1, no wasted computation ensues. &lt;br /&gt;
&lt;br /&gt;
There is a synonymous syntax, &amp;lt;code&amp;gt;_( v1, v2, v3, v4 )&amp;lt;/code&amp;gt; that can be used. When returning values from a UDF, we feel that it clearer to call [[MultiResult]]. However, the underscore function is convenient when using a multiple assignment directly, such as &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (key[], val[]) := _( dict.Key, dict );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;lt;code&amp;gt;_( ) &amp;lt;/code&amp;gt; with [[Repeated parameter forwarding]] to accomplish something that would have taken four lines of code otherwise.&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Local]] (x,y,z) := _( ...[[ParseNumber]]( [[SplitText]]( &amp;quot;10, 20, 3&amp;quot;, &amp;quot;,&amp;quot; ) ) );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Emergent iteration constructs ====&lt;br /&gt;
&lt;br /&gt;
Some new convenient forms of iteration constructs emerge from the introduction of multiple return values. For example, when iterating over an index, you can simultaneously grab the index position and the index labels in the loop declaration.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] ( pos, label ) := _( @J, J ) Do …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A 1-D array with an index containing labels is called as associative array in other programming languages. The index values are the keys and the array values are the values. Your iteration can conveniently name both the current key and the current value.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:[[For]] ( key[], val reduced ) := _( I, a ) Do …&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Assignment ===&lt;br /&gt;
* (Definition of X := array) -- setting cell expressions&lt;br /&gt;
* new ParseExpression() function&lt;br /&gt;
* Capturing multiple values&lt;br /&gt;
=== Multithreading ===&lt;br /&gt;
Added finer-grained control over which multi-threaded algorithms are enabled or disabled.  This is so that if you encounter a multi-threading-related problem with one particular algorithm, you can disable it without having to sacrifice all multi-threading.&lt;br /&gt;
&lt;br /&gt;
* [[DisableMultithreaded]]: New system variable that contains the flags.&lt;br /&gt;
* [[SetEvaluationFlag]]('multithreaded'): Function for turning on or off only within one expression.&lt;br /&gt;
&lt;br /&gt;
=== Experimental ===&lt;br /&gt;
You should not rely on experimental features while they are still experimental. They are subject to change or even cancellation in future releases, and are less thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
==== Sparse arrays ====&lt;br /&gt;
Analytica has long had support for a certain form of sparsity, which we call constant sparsity (or just const sparsity for short). When the values along a slice of an array don't vary (are constant), Analytica is often able to store the single value only, and also avoid an iteration during computations. However, many sparse arrays can't take advantage of const sparseness. We've been experimenting with fully sparse multi-dimensional arrays. With these, it is possible to have multidimensional cubes with large numbers of dimensions and immense numbers of distinct coordinates as long as the number of cell with actual data is relatively small. Such sparsity is often seen in [[MdTable]] relational-to-array transformations. &lt;br /&gt;
&lt;br /&gt;
You can use the same Analytica operators and functions on sparse arrays as you would on any other Analytica arrays, but when possible, Analytica will attempt to use sparse algorithms to process the only values that are present and produce a sparse array, maintaining fast and low-memory computation. With this we have been able to demonstrate some real-life computations on sparse BI hypercubes that were not previously possible (and which are not realistically possible with a relational table representation). &lt;br /&gt;
&lt;br /&gt;
Some operations produce non-sparse results, even when applied to sparse arrays. [[Cumulate]] applied to an array with a non-zero default value is one obvious example. This is a serious &amp;quot;gotcha&amp;quot;, because if you are manipulating arrays with quadrillions of cells, one application of a function like that and you've just created a multi-petabyte array.&lt;br /&gt;
&lt;br /&gt;
At present, only a subset of operations and functions that could have sparse-array-aware algorithms actually do; however, many of the ones that are present are the most common operations. But this incompleteness is one reason this is classified as an experimental feature.&lt;br /&gt;
&lt;br /&gt;
In addition, the sparse algorithms are at this point quite new and not battle tested, so it not unlikely that bugs may be lurking, including bugs that might produce incorrect results. One of the reasons we are including it as an experimental feature is to promote testing of the algorithms.&lt;br /&gt;
&lt;br /&gt;
===== Using sparse arrays =====&lt;br /&gt;
The use of sparse arrays is enabled by setting the system variable [[EnableSparse]] to 1.  Or, you can enable the production of a sparse array from a specific expression by using &amp;lt;code&amp;gt;[[SetEvaluationFlag]]('sparse', true', «expr»)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[MdTable]] is able to return a sparse array from a relational table, provided [[EnableSparse]] is set, or the sparse evaluation flag is on, or you set the optional «sparse» parameter to true. From there, the sparseness will propagate as you slice, add, and so on. &lt;br /&gt;
&lt;br /&gt;
Expressions like &amp;lt;code&amp;gt;a = b&amp;lt;/code&amp;gt; are often sparse, but will only return a sparse result when the evaluation context allows it. When these produce dense arrays, and those dense arrays are combined with sparse arrays, a lot of sparsity is often lost.&lt;br /&gt;
&lt;br /&gt;
== Built-in functions ==&lt;br /&gt;
=== with Multiple return values ===&lt;br /&gt;
The following built-in functions now return multiple results: [[ReadTextFile]], [[ReadImageFile]], [[ReadBinaryFile]], [[SpreadsheetOpen]], [[ReadExportFile]], [[SingularValueDecomp]], [[EigenDecomp]], [[MsgBox]], [[MantissaAndExponent]], [[CanvasDrawText]] and [[Regression]].&lt;br /&gt;
&lt;br /&gt;
See [[#Multiple return values]] above.&lt;br /&gt;
&lt;br /&gt;
=== New optional parameters to existing functions ===&lt;br /&gt;
* Added an optional parameter named «initially» parameter to [[ComputedBy]]. This provides an initial value for the parent variable, and retains the value assigned by the called in the definition. (But only when the value is a simple atom). For example, if you want to remember what file a user selected, you could use:&amp;lt;code&amp;gt;&lt;br /&gt;
 Variable filename := [[ComputedBy]](wb,&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 Variable wb := &lt;br /&gt;
      Local tmp; &lt;br /&gt;
      (tmp,filename) := [[SpreadsheetOpen]](filename); &lt;br /&gt;
      tmp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Added an optional Boolean parameter, «w1D» parameter to [[SingularValueDecomp]]. When false or omitted, it the resulting W is a square diagonal matrix. When set to true, the returned W is a vector (the diagonal).&lt;br /&gt;
&lt;br /&gt;
* Added an optional «except» parameter to [[IndexesOf]], which accepts any number of index identifiers. For example, the following sums over every index of array A  except for &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt;.&lt;br /&gt;
:::&amp;lt;code&amp;gt;[[Sum]]( A, …[[IndexesOf]](A, except:I,J) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Added a «first» parameter to [[ArgMin]], [[Argmax]], [[SubIndex]], and [[PositionInIndex]]. When omitted or false, in the event of a tie these return the ''last'' occurrence. When set to true, they return the position of the first occurrence of the tie.&lt;br /&gt;
&lt;br /&gt;
::In addition, it was previously less obvious which tie was identified by [[ArgMin]] or [[Argmax]] in the multi-dimensional case. Now it is the first or last occurrence in the natural ordering of the supplied index parameters.&lt;br /&gt;
&lt;br /&gt;
* The basis index, &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;, is now optional for the [[Regression]] function. This is for convenience when performing a 1-D regression over a scalar x.&lt;br /&gt;
&lt;br /&gt;
* Added an optional «measureOnly» boolean parameter to [[CanvasDrawText]]. &lt;br /&gt;
&lt;br /&gt;
==== For sparse arrays ====&lt;br /&gt;
* Added an optional boolean parameter «sparse» to [[MdTable]]. Experimental. See [[#Sparse arrays]].&lt;br /&gt;
* The optional Boolean «sparseCount» parameter to [[Size]]. When true, counts the actual number of values (including default values) in the sparse array.&lt;br /&gt;
&lt;br /&gt;
=== Analytic distribution functions ===&lt;br /&gt;
The analytic probability functions for all built-in distributions are now also built-in functions. For example, corresponding to the [[Triangular]] distribution function there are also the [[DensTriangular]], [[CumTriangular]] and [[CumTriangularInv]] functions. Previously, to use these functions you have to add the [[Distribution Densities Library]] to your model.&lt;br /&gt;
&lt;br /&gt;
The general naming pattern for these functions is (where «dist» is the name of the distribution):&lt;br /&gt;
* &amp;lt;code&amp;gt;Dens«dist»&amp;lt;/code&amp;gt;: The ''probability density function'' for a continuous distribution. Returns the density at «x».&lt;br /&gt;
* &amp;lt;code&amp;gt;Prob«dist»&amp;lt;/code&amp;gt;: The ''discrete probability function'' for a discrete distribution. Returns the probability of «x».&lt;br /&gt;
* &amp;lt;code&amp;gt;Cum«dist»&amp;lt;/code&amp;gt;: The cumulative probability function, also known as the ''probability function'' and ''cumulative density function''. Returns the probability of being less than or equal to «x».&lt;br /&gt;
*&amp;lt;code&amp;gt;Cum«dist»Inv&amp;lt;/code&amp;gt;: The inverse cumulative probability function, also called the ''quantile function''. Returns the «p»th fractile/percentile/quartile.&lt;br /&gt;
&lt;br /&gt;
A few of these analytic functions were already built in previously, but all of the following were added:&lt;br /&gt;
* [[DensBeta]], [[DensChiSquared]], [[DensCumDist]], [[DensExponential]], [[DensFDist]], [[DensGamma]], [[DensLogistic]], [[DensProbDist]], [[DensStudentT]], [[DensTriangular]], [[DensWeibull]].&lt;br /&gt;
* [[ProbBernoulli]], [[ProbBinomial]], [[ProbGeometric]], [[ProbHyperGeometric]], [[ProbNegativeBinomial]], [[ProbPoisson]], [[ProbUniform]]&lt;br /&gt;
* [[CumBernoulli]], [[CumBeta]], [[CumChiSquared]], [[CumCumDist]], [[CumExponential]], [[CumFDist]], [[CumGamma]], [[CumGeometric]], [[CumHyperGeometric]], [[CumLogistic]], [[CumNegativeBinomial]], [[CumProbDist]], [[CumStudentT]], [[CumTriangular]], [[CumUniform]], [[CumWeibull]].&lt;br /&gt;
* [[CumBernoulliInv]], [[CumBetaInv]], [[CumChiSquaredInv]], [[CumCumDistInv]], [[CumExponentialInv]], [[CumFDistInv]], [[CumGammaInv]], [[CumGeometricInv]], [[CumHyperGeometricInv]], [[CumLogisticInv]], [[CumNegativeBinomInv]], [[CumProbDistInv]], [[CumStudentTInv]], [[CumTriangularInv]], [[CumUniformInv]], [[CumWeibullInv]].&lt;br /&gt;
&lt;br /&gt;
=== New built-in functions ===&lt;br /&gt;
* The preceding section covered the many newly built-in analytic distribution functions.&lt;br /&gt;
&lt;br /&gt;
* The [[F-distribution]] was added as a built-in function (functions [[FDist]], [[DensFDist]], [[CumFDist]] and [[CumFDistInv]]).&lt;br /&gt;
&lt;br /&gt;
* [[ParseExpression]]: Returns a parse tree for an Analytica expression. When this is assigned to a global variable, the edit table cells are Analytica expressions. &lt;br /&gt;
&lt;br /&gt;
* [[MultiResult]](..) and [[MultiResult|_]](…) return multiple values. See [[#Returning multiple values from a UDF]].&lt;br /&gt;
&lt;br /&gt;
* [[ChangeArraySparsity]]: (experimental) converts between a sparse and standard multi-dimensional array representation.&lt;br /&gt;
&lt;br /&gt;
* [[GraphToCanvasCoord]]: For use in the [[OnGraphDraw]] expression, it maps from a data value to a pixel coordinate. See [[#OnGraphDraw]] on this page.&lt;br /&gt;
&lt;br /&gt;
* [[MantissaAndExponent]](x): Returns the mantissa and base-2 exponent of a floating point number.&lt;br /&gt;
&lt;br /&gt;
=== Enhancements to existing functions ===&lt;br /&gt;
* [[MakeJSON]] handles the encoding of multidimensional arrays better, with better control over nesting orders and ability to map some indexes to JSON objects and others to JSON arrays.&lt;br /&gt;
* Added the «except» parameter to the [[IndexesOf]] function.&lt;br /&gt;
* Added the «first» parameter to [[SubIndex]], [[ArgMin]], [[ArgMax]], [[SubIndex]] and [[PositionInIndex]]&lt;br /&gt;
* [[CellOnClick]] allows local variables in expression and supplies several new local variables to the expression. See below.&lt;br /&gt;
* When the probabilities in a [[ProbTable]] don't add to 1, the [[Mid]]-value is now determined from the normalized version, and hence may differ from the mid-value in pre-5.2 releases. The [[Sample]]-value is unaffected, since it was already determined from the normalized probabilities.&lt;br /&gt;
* Optional parameters added to [[MsgBox]] allow you to include one or two URL links and a checkbox input on the dialog.&lt;br /&gt;
* An optional parameter «getFrom» was added to [[NumberToText]]. Specify a handle to use the stored number format from an indicated object.&lt;br /&gt;
&lt;br /&gt;
=== New System Variables ===&lt;br /&gt;
The following system variables are new:&lt;br /&gt;
* [[DisableMultithreaded]]&lt;br /&gt;
* [[EnableSparse]]&lt;br /&gt;
* [[UserGoogleAPIKey]]&lt;br /&gt;
&lt;br /&gt;
== Libraries and Example Models ==&lt;br /&gt;
* New library (for [[Analytica Enterprise]] users): &amp;quot;Google Maps from OnGraphDraw&amp;quot;. Makes it easy to plot data over a Google Map via the new [[OnGraphDraw]] attribute.&lt;br /&gt;
* New example model (for [[Analytica Enterprise]] users): &amp;quot;CSV read and Google Maps plot.ana&amp;quot;, in the Data Analysis folder. Shows how to use the Google Maps plotting, how to download CSV data from a web source with fail-over to a second URL source if the first fails, and how to parse the CSV file.&lt;br /&gt;
&lt;br /&gt;
== File saving and loading ==&lt;br /&gt;
* The save author and save date are no longer written as part of the model file. These were inconvenient when tracking a model in a source control system (like git or svn) because they changed every time, and collided every time when merges were required. When a model file is read that does not have the save date, the SaveDate attribute is now set to the file system's last-modified time stamp.&lt;br /&gt;
&lt;br /&gt;
== Cell Formats ==&lt;br /&gt;
=== CellOnClick ===&lt;br /&gt;
* The «expr» inside a [[CellOnClick]] now has access to the coordinates of the cell that was clicked. From «expr», evaluating any of the index identifiers in a value context returns the coordinate of that index at the clicked cell. &lt;br /&gt;
* All the special local variables available in the [[Cell Format Expression]] attribute in general are now available inside «expr» when it is run, plus two more locals can be used: &lt;br /&gt;
** &amp;lt;code&amp;gt;TotalIndexes&amp;lt;/code&amp;gt;: A list of handles containing all indexes that are being summed over for the clicked cell.&lt;br /&gt;
** &amp;lt;code&amp;gt;comparisonColumn&amp;lt;/code&amp;gt;: When a cell is in a comparison variable column of a result table, this is the exogenous comparison variable or expression (i.e., it is either a [[handle]] or a parsed expression). If the click was not in a comparison column (the more normal case), this is null. &lt;br /&gt;
* Assignment can now occur directly from inside the «expr» of [[CellOnClick]]. Previously, you had to do it from a [[UDF]].&lt;br /&gt;
* When a cell contains a [[handle]] or [[reference]], the default behavior is to hyperlink when the user double clicks. But a [[CellOnClick]] handler overrides that. Now if the [[CellOnClick]] returns false (0), the default behavior will (also) execute.&lt;br /&gt;
&lt;br /&gt;
== Clipboard ==&lt;br /&gt;
* Paste XML Spreadsheet format&lt;br /&gt;
** Copy/paste from Excel to Analytica or from Analytica to Excel is as faithful as possible to data types and what you see is what you get&lt;br /&gt;
** Copy/paste from one instance of Analytica to another instance is similarly faithful&lt;br /&gt;
** Paste special offers XML Spreadsheet format as the default option&lt;br /&gt;
** Paste special unlinked supports user choice of clipboard format used&lt;br /&gt;
** XML Spreadsheet format offers special support for row headers and column headers on copy/paste from Analytica to Analytica&lt;br /&gt;
* The Paste menu option is enabled in browse mode when the focus could be pasted to if only you changed to edit mode. When you attempt a paste or Ctrl+V, it then asks you if you want to change to edit mode. Address a confusing &amp;quot;why isn't paste working?&amp;quot; case, where you forgot you are in browse mode.&lt;br /&gt;
&lt;br /&gt;
== General GUI ==&lt;br /&gt;
* Several enhancements to the [[Indexes dialog]] make it easier to select indexes when the list is very long.&lt;br /&gt;
** The dialog is larger, so indexes more are visible in the panes.&lt;br /&gt;
** You can now view index identifiers by pressing Ctrl+Y&lt;br /&gt;
** You can type the first few characters to quickly jump to the index that starts with those characters.&lt;br /&gt;
** The Up, Down, Page Up, and Page Down keyboard can be used to scroll the index pane.&lt;br /&gt;
** The Left or Right keys can be used to move the selected index or indexes from one pane to the other (same as pressing the &amp;gt;&amp;gt; or &amp;lt;&amp;lt; button).&lt;br /&gt;
** Use the mouse wheel to scroll the Indexes pane.&lt;br /&gt;
* More recent files recorded by default (was 6. Now 11).&lt;br /&gt;
* Added the '''Remove quotes''' option for lists&lt;br /&gt;
* Added the '''Remove quotes''' and '''Add quotes''' dropdown menu options for description and definition fields in object windows&lt;br /&gt;
** These operations support undo and redo&lt;br /&gt;
** These operations are performed in the selected area in these input windows only&lt;br /&gt;
** '''Add quotes''' is useful for the definition field when a paste operation puts data there that is meant to be a string but does not initially have quotes, escaping internal quotes as part of the operation&lt;br /&gt;
* '''Comparison Tolerance''' appears on the Definition menu. &lt;br /&gt;
* Undo for&lt;br /&gt;
** Uncertainty options... changes&lt;br /&gt;
* The preferred declaration constructs (e.g., Local..Do) appear on Definition menu, and not deprecated ones (e.g., Var..Do).&lt;br /&gt;
* When you exceed the number of characters allowed in the identifier or units field, it now displays the error in a bubble instead of a primitive model alert dialog.&lt;br /&gt;
::[[image:too_many_characters_bubble.png]]&lt;br /&gt;
&lt;br /&gt;
== Optimizer ==&lt;br /&gt;
* The add-on OptQuest engine is now available from Analytica 64-bit. Previously this engine was only available in 32-bits.&lt;br /&gt;
&lt;br /&gt;
== Wiki ==&lt;br /&gt;
* Some pages of the wiki have a release bar at the top and display different content depending on which release number is selected. The release bar looks like this:&lt;br /&gt;
*::{{ReleaseBar}}&lt;br /&gt;
*:Links from Analytica into the wiki now include the release number in the URL, so that the Wiki can automatically select the same release number that you are using. Since this is new to 5.2, release 4.6, 5.0 or 5.1 won't auto-select the release, but it will enable future releases to show the correct version-specific pages. &lt;br /&gt;
&lt;br /&gt;
== ADE ==&lt;br /&gt;
* Changed the [[CATable::GraphWithStoredPivot]] property to default to true.&lt;br /&gt;
* Method for installation of ADE without running installer. Used to create a docker container image.&lt;br /&gt;
* The binary for AdeTest is now compiled for .NET 4.6.  The project file is saved for Visual Studio 2018.&lt;br /&gt;
&lt;br /&gt;
== Retired 32-bit ==&lt;br /&gt;
Analytica 5.2 is being released only in 64-bit. The 32-bit edition has been retired.&lt;br /&gt;
&lt;br /&gt;
== Licensing ==&lt;br /&gt;
* Fixed a bug where RLM Server name didn't stick in licensing dialog. This caused problems for users of floating licenses and required them to manually set a registry setting to get around it.&lt;br /&gt;
* Changed beta-build licensing. Formerly a separate beta testing license was required. Now any active subscription license (i.e., expiring 5.x license) is sufficient. Thus, we eliminated lots of complex code for automatically acquiring and updating beta test licenses during the beta testing period.&lt;br /&gt;
&lt;br /&gt;
== Typescript ==&lt;br /&gt;
* The Up and Down arrow keys recall history, like Ctrl+Up and Ctrl+Down already do.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61810</id>
		<title>Embed an ACP model in a Web Page</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61810"/>
		<updated>2024-11-19T01:01:41Z</updated>

		<summary type="html">&lt;p&gt;Max: /* ACP in an Iframe on a wiki */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica Cloud Platform]]&lt;br /&gt;
[[Category:  Models]]&lt;br /&gt;
&lt;br /&gt;
[[Analytica_Cloud_Platform|&amp;lt;&amp;lt;back]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
People normally view [[Analytica Cloud Platform]] (ACP) models on an acp server  such as [https://ACP.Analytica.com  https://ACP.Analytica.com].  However, you can also embed an ACP model in any web page, for example on your own web site, to make it more easily accessible to end users.  When you do this, your users see the ACP model as a region in an iFrame within your HTML content, although the model is actually being run on the ACP server.  &lt;br /&gt;
&lt;br /&gt;
This page explains how to configure your own web page to display an ACP model.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite:''' You must already have an ACP account, which you do if you have a subscription to any desktop Edition of Analytica.&lt;br /&gt;
&lt;br /&gt;
The model will appear and use an ACP session credit whenever a user visits the web page. You can avoid this (and the time delay while the ACP model loads) by hiding the model behind a screenshot of the ACP mode. You can add code to start the model and use a session credit only when a user clicks the screenshot.&lt;br /&gt;
&lt;br /&gt;
==Showing your model in an inline Frame (Iframe)==&lt;br /&gt;
An inline frame is just an HTML document embedded inside another HTML document on a website. &lt;br /&gt;
&lt;br /&gt;
=== Step 1: Create a Web page. ===&lt;br /&gt;
To keep it simple, let’s say you just want to display an ACP model in an otherwise empty web page, in an Iframe. We’ll show you an example of how to do this, and hopefully that’s enough for you to get started on playing your own model within a web page on your web site.&lt;br /&gt;
&lt;br /&gt;
In this example, there are two servers.  &lt;br /&gt;
*Your Server, the server where your web site resides.  This is the server you are able to upload and edit pages on.&lt;br /&gt;
*And there’s ACP’s server, https://acp.analytica.com, which hosts ACP and will contain the web page that plays your model. ''Since this page is an HTML frame, it will appear the model is being played on your web site.''&lt;br /&gt;
&lt;br /&gt;
#First, create a web page - you can use a text editor. Here is one that just contains a title, 'Look at My Analytica Model'. Save this as an html file ACPIframe.html.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opened in the Chrome browser this is what this web page initially displays :&lt;br /&gt;
&lt;br /&gt;
:[[File:ACPIFrame01.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 - Creating the Link to Play Your Model ===&lt;br /&gt;
Use ACP’s Email Invite functionality to create the link which will play your model.&lt;br /&gt;
&lt;br /&gt;
#[https://acp.analytica.com/ Sign into your ACP account]  &lt;br /&gt;
#If your model doesn't already use  [[ACP_Auto_zoom|Auto Zoom]] style that will make the ACP zoom to fit the Iframe, you should make it do so. Click the model to open it in ACP, select ACP Style lib, and set it to Auto Zoom. Then save the model.&lt;br /&gt;
#Click a radio button to select your model -- in this example. the Project portfolio planner.ana.&lt;br /&gt;
#:[[File:ACPFrame01.png|720px|thumb|left]]&lt;br /&gt;
#Click the '''Email Invite''' button to show the email invitation dialog:&lt;br /&gt;
#Copy the link from this email invite. &amp;lt;br/&amp;gt;&lt;br /&gt;
#:[[File:ACPFrame02.png|720px|thumb|left]]&amp;lt;br/&amp;gt;&lt;br /&gt;
#Press '''Cancel''' button, since we aren’t sending the invite to anyone.&lt;br /&gt;
&lt;br /&gt;
''Note: Ensure a model you insert in a web page stays in the same ACP Model Project and folder.'' If you delete it, the web page will show an error message saying &amp;quot;the model can't be found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Step 3: Insert the code for an Iframe. ===&lt;br /&gt;
&lt;br /&gt;
1. Now in the  web page source Insert the code for an Iframe with the link to your model in it.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Set the Iframe to be a size that looks good for your model diagram, and that fits with auto zoom. It will probably need to be tweaked later, but you can do this by playing the model in ACP, and by using developer's tools or by taking a screenshot of the model and checking the dimensions. In this case the model looks good at width: 900px; height: 446px.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add Iframe html tags and paste the link for your model into the &amp;quot;src&amp;quot; attribute, and the code for ACPIframe.html will look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;iframe width=&amp;quot;900&amp;quot; height=&amp;quot;446&amp;quot; src=&amp;quot;https://acp.analytica.com/view?invite=4771&amp;amp;amp;code=2359748081441958275&amp;quot;&amp;amp;gt;&amp;amp;lt;/iframe&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Now you can save the web page and load it in a browser. Or you can see it on the Analytica docs server here: [https://docs.analytica.com/custom_pages/ACPIframe.html https://docs.analytica.com/custom_pages/ACPIframe.html]&lt;br /&gt;
It will display the model in the iframe like this:&lt;br /&gt;
:[[File:ACPIFrame02.png|720px|thumb|left]]&lt;br /&gt;
Download the example html [[File:ACPIframe.zip]].&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
You can follow this link http://analyticaonline.com/acp3Inawebpage/acp3Iframe.htm to see ACP playing a model in an iframe on one of our servers.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Put an ACP model behind an image==&lt;br /&gt;
To avoid the ACP model loading each time the page is visited, you can hide the model behind an image, and add code to start the model when the  image is clicked like a button. &lt;br /&gt;
&lt;br /&gt;
'''Tip:''' To save time and get the screen shots to paste into an editor at close to the same size as what you are seeing in the browser, you may want to adjust your display settings to 100%.&lt;br /&gt;
&lt;br /&gt;
1. Make a display image to put over the iframe when ACP is not running the model. Here is one way to do this:&lt;br /&gt;
a. Enter the source url from the html into the address bar for Chrome. Then with the browser unmaximized, adjust the window size until it looks good and the zoom fits the diagram. Using developer's tools elements tab I can see the model diagram looks pretty good at 900px wide; 447px height;.[[File:ACPIFrame05.png|720px|thumb|left]]&lt;br /&gt;
b. Take a screenshot, crop it to remove all but the model and the top bar and save the image.&lt;br /&gt;
[[File:ACPIFrame06.png|720px|thumb|left]]&lt;br /&gt;
2. Save the image where it is accessible to the javascript - for instance, in the same folder or in an uploads directory.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add a div in the html source containing the container with the display image. And the script following.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; style=&amp;quot;cursor: pointer; border: 1px solid #ccc; padding: 10px; margin: 10px; width: 900px; height: 447px;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot; style=&amp;quot;width: 100%; height: 100%;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the image&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create and configure the iframe&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4714&amp;amp;code=4200729999208732852';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '900px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '446px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Append the iframe to the container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Add click event listener to the image container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download the example html file and image [[File:ACPIModelBehindImage.zip]]&lt;br /&gt;
&lt;br /&gt;
You can see what this page looks like here: [https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html]&lt;br /&gt;
&lt;br /&gt;
== Buttons to expand to full screen and minimize==&lt;br /&gt;
&lt;br /&gt;
It's convenient for users to be able to expand an embedded ACP window to the full browser window -- and to minimize it again.  Here's a live example:  [[https://docs.analytica.com/custom_pages/ACPIframeInteract.html https://docs.analytica.com/custom_pages/ACPIframeInteract.html]&lt;br /&gt;
Here is how to add &lt;br /&gt;
* a maximize button [[File:Arrows-maximize.png|24px]] to show the Iframe fullscreen -  visible in the Iframe when the model is running at normal size.&lt;br /&gt;
* a minimize button [[File:Arrows-minimize.png|24px]] to exitfull screen visible when the Iframe is full screen.&lt;br /&gt;
* a button on the Iframe labeled &amp;quot;click to interact with the model in Analytica Cloud Platform&amp;quot; to clarify that you need to click it to start the model in ACP.&lt;br /&gt;
* Some styling with a 1 pixel wide outline and a drop shadow. You can set these in a css file too.&lt;br /&gt;
* The fullscreen and minimize icons from the docs.analytica.com wiki - just use links to them for now.&lt;br /&gt;
&lt;br /&gt;
Here is an example html file with the code to add these extra features, using the same overlay image as before: [[File:ACPIframeInteract.zip]]&lt;br /&gt;
&lt;br /&gt;
Here is some updated html and script.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Interactive Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#container {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: relative;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 900px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 447px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;margin: 0 auto;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: 1px solid #ccc;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#runImage {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;.control-button {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-size: contain;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-repeat: no-repeat;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: transparent;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#maximizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/9/9c/Arrows-maximize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#minimizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/8/82/Arrows-minimize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#interactButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;padding: 5px 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-size: 16px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-weight: bold;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: #e4e4e4;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;color: black;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border-radius: 5px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;opacity: 0.9;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: inline-block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;maximizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Click to use full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;minimizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Exit full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;interactButton&amp;quot;&amp;amp;gt;Click to interact with the model in Analytica Cloud Platform&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframeAdded = false;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const runImage = document.getElementById('runImage');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;runImage.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframeAdded) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4771&amp;amp;code=2359748081441958275';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframeAdded = true;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function maximizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (container.requestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.webkitRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.webkitRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.msRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.msRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function minimizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.exitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.webkitExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.webkitExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.msExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.msExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wiki==&lt;br /&gt;
You cannot usually add html or javascript into a mediawiki page.  Instead, you can run the code in a widget. To do this you need to install the widget extension, then save the code as a widget page  and put the widget into your mediawiki page.&lt;br /&gt;
*Here's an example page in Analytica docs which uses a widget file to run the same model. [https://docs.analytica.com/index.php/Testiframe https://docs.analytica.com/index.php/Testiframe].&lt;br /&gt;
*You can inspect this code by navigating to the page and selecting &amp;lt;code&amp;gt;This page &amp;gt; show source&amp;lt;/code&amp;gt;. &lt;br /&gt;
*You can also navigate to the widget page and view the source: [https://docs.analytica.com/index.php/Widget:Ppplanner05 https://docs.analytica.com/index.php/Widget:Ppplanner05].&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wordpress site==&lt;br /&gt;
Running live on this page: [https://analytica.com/acpiframeminmax/ https://analytica.com/acpiframeminmax/]&lt;br /&gt;
To add an iframe running an ACP model on an Elementor page:&lt;br /&gt;
*Upload images needed to your wordpress site and note the location and urls.&lt;br /&gt;
*Click edit with Elementor.&lt;br /&gt;
*Add a new section then drag an HTML widget onto the section.&lt;br /&gt;
* In the code block for the HTML widget enter the code for your overlay image and for your iframe.&lt;br /&gt;
**Here is the code for this Iframe: you would need to edit the images and styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the &amp;quot;Interact&amp;quot; button if present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (interactButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if iframe is already present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframe) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.id = 'embeddedIframe';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view0?invite=4314&amp;amp;amp;code=2462049136540573676';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure maximize button is displayed&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!maximizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.id = 'maximizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.title = 'Click to use full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-maximize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(maximizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure minimize button is created&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!minimizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.id = 'minimizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.title = 'Exit full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.position = 'fixed';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-minimize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none'; // Hidden initially&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(minimizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Event listener to handle fullscreen changes&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('fullscreenchange', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if in fullscreen mode&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.fullscreenElement) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Restore iframe size when exiting fullscreen&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create the &amp;quot;Click to interact&amp;quot; button&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.id = 'interactButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.textContent = &amp;quot;Click to interact with the model in Analytica Cloud Platform&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.bottom = '13px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.right = '140px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.padding = '5px 10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontSize = '16px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontWeight = 'bold';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.backgroundColor = '#d3d3d3';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.color = 'black';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.borderRadius = '5px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.opacity = '0.9';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.onclick = function(event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(interactButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; class=&amp;quot;screenshot-border&amp;quot; style=&amp;quot;position: relative; width: 100%; height: auto;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;https://analytica.com/wp-content/uploads/2023/07/ev-vs-ice-1.webp&amp;quot; width=&amp;quot;1210px&amp;quot; height=&amp;quot;648px&amp;quot; onclick=&amp;quot;showIframe()&amp;quot; style=&amp;quot;cursor: pointer;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
'''&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;Coming...this section is under construction.&amp;lt;/font&amp;gt;'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Analytica Cloud Player]]&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Tutorial: Sharing a model with ACP]]&lt;br /&gt;
* [[Model Licensing]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61809</id>
		<title>Embed an ACP model in a Web Page</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61809"/>
		<updated>2024-11-19T00:59:25Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Add a Full screen button and minimize button to the Iframe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica Cloud Platform]]&lt;br /&gt;
[[Category:  Models]]&lt;br /&gt;
&lt;br /&gt;
[[Analytica_Cloud_Platform|&amp;lt;&amp;lt;back]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
People normally view [[Analytica Cloud Platform]] (ACP) models on an acp server  such as [https://ACP.Analytica.com  https://ACP.Analytica.com].  However, you can also embed an ACP model in any web page, for example on your own web site, to make it more easily accessible to end users.  When you do this, your users see the ACP model as a region in an iFrame within your HTML content, although the model is actually being run on the ACP server.  &lt;br /&gt;
&lt;br /&gt;
This page explains how to configure your own web page to display an ACP model.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite:''' You must already have an ACP account, which you do if you have a subscription to any desktop Edition of Analytica.&lt;br /&gt;
&lt;br /&gt;
The model will appear and use an ACP session credit whenever a user visits the web page. You can avoid this (and the time delay while the ACP model loads) by hiding the model behind a screenshot of the ACP mode. You can add code to start the model and use a session credit only when a user clicks the screenshot.&lt;br /&gt;
&lt;br /&gt;
==Showing your model in an inline Frame (Iframe)==&lt;br /&gt;
An inline frame is just an HTML document embedded inside another HTML document on a website. &lt;br /&gt;
&lt;br /&gt;
=== Step 1: Create a Web page. ===&lt;br /&gt;
To keep it simple, let’s say you just want to display an ACP model in an otherwise empty web page, in an Iframe. We’ll show you an example of how to do this, and hopefully that’s enough for you to get started on playing your own model within a web page on your web site.&lt;br /&gt;
&lt;br /&gt;
In this example, there are two servers.  &lt;br /&gt;
*Your Server, the server where your web site resides.  This is the server you are able to upload and edit pages on.&lt;br /&gt;
*And there’s ACP’s server, https://acp.analytica.com, which hosts ACP and will contain the web page that plays your model. ''Since this page is an HTML frame, it will appear the model is being played on your web site.''&lt;br /&gt;
&lt;br /&gt;
#First, create a web page - you can use a text editor. Here is one that just contains a title, 'Look at My Analytica Model'. Save this as an html file ACPIframe.html.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opened in the Chrome browser this is what this web page initially displays :&lt;br /&gt;
&lt;br /&gt;
:[[File:ACPIFrame01.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 - Creating the Link to Play Your Model ===&lt;br /&gt;
Use ACP’s Email Invite functionality to create the link which will play your model.&lt;br /&gt;
&lt;br /&gt;
#[https://acp.analytica.com/ Sign into your ACP account]  &lt;br /&gt;
#If your model doesn't already use  [[ACP_Auto_zoom|Auto Zoom]] style that will make the ACP zoom to fit the Iframe, you should make it do so. Click the model to open it in ACP, select ACP Style lib, and set it to Auto Zoom. Then save the model.&lt;br /&gt;
#Click a radio button to select your model -- in this example. the Project portfolio planner.ana.&lt;br /&gt;
#:[[File:ACPFrame01.png|720px|thumb|left]]&lt;br /&gt;
#Click the '''Email Invite''' button to show the email invitation dialog:&lt;br /&gt;
#Copy the link from this email invite. &amp;lt;br/&amp;gt;&lt;br /&gt;
#:[[File:ACPFrame02.png|720px|thumb|left]]&amp;lt;br/&amp;gt;&lt;br /&gt;
#Press '''Cancel''' button, since we aren’t sending the invite to anyone.&lt;br /&gt;
&lt;br /&gt;
''Note: Ensure a model you insert in a web page stays in the same ACP Model Project and folder.'' If you delete it, the web page will show an error message saying &amp;quot;the model can't be found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Step 3: Insert the code for an Iframe. ===&lt;br /&gt;
&lt;br /&gt;
1. Now in the  web page source Insert the code for an Iframe with the link to your model in it.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Set the Iframe to be a size that looks good for your model diagram, and that fits with auto zoom. It will probably need to be tweaked later, but you can do this by playing the model in ACP, and by using developer's tools or by taking a screenshot of the model and checking the dimensions. In this case the model looks good at width: 900px; height: 446px.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add Iframe html tags and paste the link for your model into the &amp;quot;src&amp;quot; attribute, and the code for ACPIframe.html will look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;iframe width=&amp;quot;900&amp;quot; height=&amp;quot;446&amp;quot; src=&amp;quot;https://acp.analytica.com/view?invite=4771&amp;amp;amp;code=2359748081441958275&amp;quot;&amp;amp;gt;&amp;amp;lt;/iframe&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Now you can save the web page and load it in a browser. Or you can see it on the Analytica docs server here: [https://docs.analytica.com/custom_pages/ACPIframe.html https://docs.analytica.com/custom_pages/ACPIframe.html]&lt;br /&gt;
It will display the model in the iframe like this:&lt;br /&gt;
:[[File:ACPIFrame02.png|720px|thumb|left]]&lt;br /&gt;
Download the example html [[File:ACPIframe.zip]].&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
You can follow this link http://analyticaonline.com/acp3Inawebpage/acp3Iframe.htm to see ACP playing a model in an iframe on one of our servers.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Put an ACP model behind an image==&lt;br /&gt;
To avoid the ACP model loading each time the page is visited, you can hide the model behind an image, and add code to start the model when the  image is clicked like a button. &lt;br /&gt;
&lt;br /&gt;
'''Tip:''' To save time and get the screen shots to paste into an editor at close to the same size as what you are seeing in the browser, you may want to adjust your display settings to 100%.&lt;br /&gt;
&lt;br /&gt;
1. Make a display image to put over the iframe when ACP is not running the model. Here is one way to do this:&lt;br /&gt;
a. Enter the source url from the html into the address bar for Chrome. Then with the browser unmaximized, adjust the window size until it looks good and the zoom fits the diagram. Using developer's tools elements tab I can see the model diagram looks pretty good at 900px wide; 447px height;.[[File:ACPIFrame05.png|720px|thumb|left]]&lt;br /&gt;
b. Take a screenshot, crop it to remove all but the model and the top bar and save the image.&lt;br /&gt;
[[File:ACPIFrame06.png|720px|thumb|left]]&lt;br /&gt;
2. Save the image where it is accessible to the javascript - for instance, in the same folder or in an uploads directory.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add a div in the html source containing the container with the display image. And the script following.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; style=&amp;quot;cursor: pointer; border: 1px solid #ccc; padding: 10px; margin: 10px; width: 900px; height: 447px;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot; style=&amp;quot;width: 100%; height: 100%;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the image&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create and configure the iframe&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4714&amp;amp;code=4200729999208732852';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '900px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '446px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Append the iframe to the container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Add click event listener to the image container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download the example html file and image [[File:ACPIModelBehindImage.zip]]&lt;br /&gt;
&lt;br /&gt;
You can see what this page looks like here: [https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html]&lt;br /&gt;
&lt;br /&gt;
== Buttons to expand to full screen and minimize==&lt;br /&gt;
&lt;br /&gt;
It's convenient for users to be able to expand an embedded ACP window to the full browser window -- and to minimize it again.  Here's a live example:  [[https://docs.analytica.com/custom_pages/ACPIframeInteract.html https://docs.analytica.com/custom_pages/ACPIframeInteract.html]&lt;br /&gt;
Here is how to add &lt;br /&gt;
* a maximize button [[File:Arrows-maximize.png|24px]] to show the Iframe fullscreen -  visible in the Iframe when the model is running at normal size.&lt;br /&gt;
* a minimize button [[File:Arrows-minimize.png|24px]] to exitfull screen visible when the Iframe is full screen.&lt;br /&gt;
* a button on the Iframe labeled &amp;quot;click to interact with the model in Analytica Cloud Platform&amp;quot; to clarify that you need to click it to start the model in ACP.&lt;br /&gt;
* Some styling with a 1 pixel wide outline and a drop shadow. You can set these in a css file too.&lt;br /&gt;
* The fullscreen and minimize icons from the docs.analytica.com wiki - just use links to them for now.&lt;br /&gt;
&lt;br /&gt;
Here is an example html file with the code to add these extra features, using the same overlay image as before: [[File:ACPIframeInteract.zip]]&lt;br /&gt;
&lt;br /&gt;
Here is some updated html and script.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Interactive Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#container {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: relative;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 900px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 447px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;margin: 0 auto;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: 1px solid #ccc;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#runImage {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;.control-button {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-size: contain;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-repeat: no-repeat;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: transparent;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#maximizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/9/9c/Arrows-maximize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#minimizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/8/82/Arrows-minimize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#interactButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;padding: 5px 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-size: 16px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-weight: bold;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: #e4e4e4;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;color: black;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border-radius: 5px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;opacity: 0.9;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: inline-block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;maximizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Click to use full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;minimizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Exit full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;interactButton&amp;quot;&amp;amp;gt;Click to interact with the model in Analytica Cloud Platform&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframeAdded = false;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const runImage = document.getElementById('runImage');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;runImage.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframeAdded) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4771&amp;amp;code=2359748081441958275';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframeAdded = true;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function maximizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (container.requestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.webkitRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.webkitRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.msRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.msRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function minimizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.exitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.webkitExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.webkitExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.msExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.msExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wiki==&lt;br /&gt;
*Putting html or javascript into a mediawiki page is generally not supported directly.&lt;br /&gt;
*You can run the code in a widget. To do this you need to install the widget extension, then save the code as a widget page  and put the widget into your mediawiki page..&lt;br /&gt;
*Here is an example page on the Analytica docs which uses a widget file to run the same model. [https://docs.analytica.com/index.php/Testiframe https://docs.analytica.com/index.php/Testiframe].&lt;br /&gt;
*You can inspect this code by navigating to the page and selecting &amp;lt;code&amp;gt;This page &amp;gt; show source&amp;lt;/code&amp;gt;. &lt;br /&gt;
*You can also navigate to the widget page and view the source: [https://docs.analytica.com/index.php/Widget:Ppplanner05 https://docs.analytica.com/index.php/Widget:Ppplanner05].&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wordpress site==&lt;br /&gt;
Running live on this page: [https://analytica.com/acpiframeminmax/ https://analytica.com/acpiframeminmax/]&lt;br /&gt;
To add an iframe running an ACP model on an Elementor page:&lt;br /&gt;
*Upload images needed to your wordpress site and note the location and urls.&lt;br /&gt;
*Click edit with Elementor.&lt;br /&gt;
*Add a new section then drag an HTML widget onto the section.&lt;br /&gt;
* In the code block for the HTML widget enter the code for your overlay image and for your iframe.&lt;br /&gt;
**Here is the code for this Iframe: you would need to edit the images and styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the &amp;quot;Interact&amp;quot; button if present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (interactButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if iframe is already present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframe) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.id = 'embeddedIframe';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view0?invite=4314&amp;amp;amp;code=2462049136540573676';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure maximize button is displayed&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!maximizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.id = 'maximizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.title = 'Click to use full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-maximize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(maximizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure minimize button is created&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!minimizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.id = 'minimizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.title = 'Exit full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.position = 'fixed';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-minimize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none'; // Hidden initially&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(minimizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Event listener to handle fullscreen changes&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('fullscreenchange', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if in fullscreen mode&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.fullscreenElement) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Restore iframe size when exiting fullscreen&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create the &amp;quot;Click to interact&amp;quot; button&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.id = 'interactButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.textContent = &amp;quot;Click to interact with the model in Analytica Cloud Platform&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.bottom = '13px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.right = '140px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.padding = '5px 10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontSize = '16px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontWeight = 'bold';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.backgroundColor = '#d3d3d3';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.color = 'black';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.borderRadius = '5px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.opacity = '0.9';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.onclick = function(event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(interactButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; class=&amp;quot;screenshot-border&amp;quot; style=&amp;quot;position: relative; width: 100%; height: auto;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;https://analytica.com/wp-content/uploads/2023/07/ev-vs-ice-1.webp&amp;quot; width=&amp;quot;1210px&amp;quot; height=&amp;quot;648px&amp;quot; onclick=&amp;quot;showIframe()&amp;quot; style=&amp;quot;cursor: pointer;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
'''&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;Coming...this section is under construction.&amp;lt;/font&amp;gt;'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Analytica Cloud Player]]&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Tutorial: Sharing a model with ACP]]&lt;br /&gt;
* [[Model Licensing]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61808</id>
		<title>Embed an ACP model in a Web Page</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Embed_an_ACP_model_in_a_Web_Page&amp;diff=61808"/>
		<updated>2024-11-19T00:47:57Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica Cloud Platform]]&lt;br /&gt;
[[Category:  Models]]&lt;br /&gt;
&lt;br /&gt;
[[Analytica_Cloud_Platform|&amp;lt;&amp;lt;back]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
People normally view [[Analytica Cloud Platform]] (ACP) models on an acp server  such as [https://ACP.Analytica.com  https://ACP.Analytica.com].  However, you can also embed an ACP model in any web page, for example on your own web site, to make it more easily accessible to end users.  When you do this, your users see the ACP model as a region in an iFrame within your HTML content, although the model is actually being run on the ACP server.  &lt;br /&gt;
&lt;br /&gt;
This page explains how to configure your own web page to display an ACP model.&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite:''' You must already have an ACP account, which you do if you have a subscription to any desktop Edition of Analytica.&lt;br /&gt;
&lt;br /&gt;
The model will appear and use an ACP session credit whenever a user visits the web page. You can avoid this (and the time delay while the ACP model loads) by hiding the model behind a screenshot of the ACP mode. You can add code to start the model and use a session credit only when a user clicks the screenshot.&lt;br /&gt;
&lt;br /&gt;
==Showing your model in an inline Frame (Iframe)==&lt;br /&gt;
An inline frame is just an HTML document embedded inside another HTML document on a website. &lt;br /&gt;
&lt;br /&gt;
=== Step 1: Create a Web page. ===&lt;br /&gt;
To keep it simple, let’s say you just want to display an ACP model in an otherwise empty web page, in an Iframe. We’ll show you an example of how to do this, and hopefully that’s enough for you to get started on playing your own model within a web page on your web site.&lt;br /&gt;
&lt;br /&gt;
In this example, there are two servers.  &lt;br /&gt;
*Your Server, the server where your web site resides.  This is the server you are able to upload and edit pages on.&lt;br /&gt;
*And there’s ACP’s server, https://acp.analytica.com, which hosts ACP and will contain the web page that plays your model. ''Since this page is an HTML frame, it will appear the model is being played on your web site.''&lt;br /&gt;
&lt;br /&gt;
#First, create a web page - you can use a text editor. Here is one that just contains a title, 'Look at My Analytica Model'. Save this as an html file ACPIframe.html.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When opened in the Chrome browser this is what this web page initially displays :&lt;br /&gt;
&lt;br /&gt;
:[[File:ACPIFrame01.png]]&lt;br /&gt;
&lt;br /&gt;
=== Step 2 - Creating the Link to Play Your Model ===&lt;br /&gt;
Use ACP’s Email Invite functionality to create the link which will play your model.&lt;br /&gt;
&lt;br /&gt;
#[https://acp.analytica.com/ Sign into your ACP account]  &lt;br /&gt;
#If your model doesn't already use  [[ACP_Auto_zoom|Auto Zoom]] style that will make the ACP zoom to fit the Iframe, you should make it do so. Click the model to open it in ACP, select ACP Style lib, and set it to Auto Zoom. Then save the model.&lt;br /&gt;
#Click a radio button to select your model -- in this example. the Project portfolio planner.ana.&lt;br /&gt;
#:[[File:ACPFrame01.png|720px|thumb|left]]&lt;br /&gt;
#Click the '''Email Invite''' button to show the email invitation dialog:&lt;br /&gt;
#Copy the link from this email invite. &amp;lt;br/&amp;gt;&lt;br /&gt;
#:[[File:ACPFrame02.png|720px|thumb|left]]&amp;lt;br/&amp;gt;&lt;br /&gt;
#Press '''Cancel''' button, since we aren’t sending the invite to anyone.&lt;br /&gt;
&lt;br /&gt;
''Note: Ensure a model you insert in a web page stays in the same ACP Model Project and folder.'' If you delete it, the web page will show an error message saying &amp;quot;the model can't be found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Step 3: Insert the code for an Iframe. ===&lt;br /&gt;
&lt;br /&gt;
1. Now in the  web page source Insert the code for an Iframe with the link to your model in it.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Set the Iframe to be a size that looks good for your model diagram, and that fits with auto zoom. It will probably need to be tweaked later, but you can do this by playing the model in ACP, and by using developer's tools or by taking a screenshot of the model and checking the dimensions. In this case the model looks good at width: 900px; height: 446px.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add Iframe html tags and paste the link for your model into the &amp;quot;src&amp;quot; attribute, and the code for ACPIframe.html will look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;iframe width=&amp;quot;900&amp;quot; height=&amp;quot;446&amp;quot; src=&amp;quot;https://acp.analytica.com/view?invite=4771&amp;amp;amp;code=2359748081441958275&amp;quot;&amp;amp;gt;&amp;amp;lt;/iframe&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Now you can save the web page and load it in a browser. Or you can see it on the Analytica docs server here: [https://docs.analytica.com/custom_pages/ACPIframe.html https://docs.analytica.com/custom_pages/ACPIframe.html]&lt;br /&gt;
It will display the model in the iframe like this:&lt;br /&gt;
:[[File:ACPIFrame02.png|720px|thumb|left]]&lt;br /&gt;
Download the example html [[File:ACPIframe.zip]].&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
You can follow this link http://analyticaonline.com/acp3Inawebpage/acp3Iframe.htm to see ACP playing a model in an iframe on one of our servers.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Put an ACP model behind an image==&lt;br /&gt;
To avoid the ACP model loading each time the page is visited, you can hide the model behind an image, and add code to start the model when the  image is clicked like a button. &lt;br /&gt;
&lt;br /&gt;
'''Tip:''' To save time and get the screen shots to paste into an editor at close to the same size as what you are seeing in the browser, you may want to adjust your display settings to 100%.&lt;br /&gt;
&lt;br /&gt;
1. Make a display image to put over the iframe when ACP is not running the model. Here is one way to do this:&lt;br /&gt;
a. Enter the source url from the html into the address bar for Chrome. Then with the browser unmaximized, adjust the window size until it looks good and the zoom fits the diagram. Using developer's tools elements tab I can see the model diagram looks pretty good at 900px wide; 447px height;.[[File:ACPIFrame05.png|720px|thumb|left]]&lt;br /&gt;
b. Take a screenshot, crop it to remove all but the model and the top bar and save the image.&lt;br /&gt;
[[File:ACPIFrame06.png|720px|thumb|left]]&lt;br /&gt;
2. Save the image where it is accessible to the javascript - for instance, in the same folder or in an uploads directory.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Add a div in the html source containing the container with the display image. And the script following.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1&amp;amp;gt;Look at My Analytica Model&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; style=&amp;quot;cursor: pointer; border: 1px solid #ccc; padding: 10px; margin: 10px; width: 900px; height: 447px;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot; style=&amp;quot;width: 100%; height: 100%;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the image&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create and configure the iframe&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4714&amp;amp;code=4200729999208732852';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '900px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '446px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Append the iframe to the container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Add click event listener to the image container&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('container').addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download the example html file and image [[File:ACPIModelBehindImage.zip]]&lt;br /&gt;
&lt;br /&gt;
You can see what this page looks like here: [https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html https://docs.analytica.com/custom_pages/ACPModelBehindIframe.html]&lt;br /&gt;
&lt;br /&gt;
==Add a Full screen button and minimize button to the Iframe==&lt;br /&gt;
* You can see this page live here  [[https://docs.analytica.com/custom_pages/ACPIframeInteract.html https://docs.analytica.com/custom_pages/ACPIframeInteract.html]&lt;br /&gt;
* Here we add a button Maximize button [[File:Arrows-maximize.png|24px]] to show the Iframe fullscreen - only visible when the Iframe is showing and the model is running at normal lsize.&lt;br /&gt;
* Also a minimize button [[File:Arrows-minimize.png|24px]] to get out of full screen which only shows when the Iframe is full screen.&lt;br /&gt;
* Also add a button attached to the Iframe which shows the text &amp;quot;click to interact with the model in Analytica Cloud Platform&amp;quot; to clarify thatyou actually need to click the image (or the button) to play the model in ACP.&lt;br /&gt;
* Add some styling with a 1 pixel wide outline and a drop shadow. You can set these in a css file too.&lt;br /&gt;
* And add the fullscreen and minimize icons from the docs.analytica.com wiki - just use links to them for now.&lt;br /&gt;
&lt;br /&gt;
*Here is an example html file with the code to add these extra features, using the same overlay image as before: [[File:ACPIframeInteract.zip]]&lt;br /&gt;
&lt;br /&gt;
* Here is some updated html and script.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;!DOCTYPE html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;title&amp;amp;gt;Interactive Analytica Model&amp;amp;lt;/title&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#container {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: relative;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 900px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 447px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;margin: 0 auto;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: 1px solid #ccc;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#runImage {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 100%;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;.control-button {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;width: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;height: 30px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-size: contain;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-repeat: no-repeat;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: transparent;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#maximizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/9/9c/Arrows-maximize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#minimizeButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-image: url(&amp;quot;https://docs.analytica.com/images/8/82/Arrows-minimize.png&amp;quot;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#interactButton {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;position: absolute;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;bottom: 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;right: 120px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;padding: 5px 10px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-size: 16px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;font-weight: bold;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;background-color: #e4e4e4;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;color: black;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border: none;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;border-radius: 5px;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;cursor: pointer;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;opacity: 0.9;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;display: inline-block;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/style&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/head&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;ACPIframe02.png&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;maximizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Click to use full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;minimizeButton&amp;quot; class=&amp;quot;control-button&amp;quot; title=&amp;quot;Exit full screen&amp;quot;&amp;amp;gt;&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;button id=&amp;quot;interactButton&amp;quot;&amp;amp;gt;Click to interact with the model in Analytica Cloud Platform&amp;amp;lt;/button&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function () {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframeAdded = false;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const runImage = document.getElementById('runImage');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;runImage.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframeAdded) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view?invite=4771&amp;amp;code=2359748081441958275';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '100%';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframeAdded = true;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function maximizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (container.requestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.webkitRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.webkitRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (container.msRequestFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.msRequestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function minimizeIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.exitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.webkitExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.webkitExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else if (document.msExitFullscreen) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.msExitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'inline-block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.addEventListener('click', function (event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.addEventListener('click', showIframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/body&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wiki==&lt;br /&gt;
*Putting html or javascript into a mediawiki page is generally not supported directly.&lt;br /&gt;
*You can run the code in a widget. To do this you need to install the widget extension, then save the code as a widget page  and put the widget into your mediawiki page..&lt;br /&gt;
*Here is an example page on the Analytica docs which uses a widget file to run the same model. [https://docs.analytica.com/index.php/Testiframe https://docs.analytica.com/index.php/Testiframe].&lt;br /&gt;
*You can inspect this code by navigating to the page and selecting &amp;lt;code&amp;gt;This page &amp;gt; show source&amp;lt;/code&amp;gt;. &lt;br /&gt;
*You can also navigate to the widget page and view the source: [https://docs.analytica.com/index.php/Widget:Ppplanner05 https://docs.analytica.com/index.php/Widget:Ppplanner05].&lt;br /&gt;
&lt;br /&gt;
==ACP in an Iframe on a wordpress site==&lt;br /&gt;
Running live on this page: [https://analytica.com/acpiframeminmax/ https://analytica.com/acpiframeminmax/]&lt;br /&gt;
To add an iframe running an ACP model on an Elementor page:&lt;br /&gt;
*Upload images needed to your wordpress site and note the location and urls.&lt;br /&gt;
*Click edit with Elementor.&lt;br /&gt;
*Add a new section then drag an HTML widget onto the section.&lt;br /&gt;
* In the code block for the HTML widget enter the code for your overlay image and for your iframe.&lt;br /&gt;
**Here is the code for this Iframe: you would need to edit the images and styles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left: 2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;function showIframe() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.getElementById('runImage').style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.getElementById('interactButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Hide the &amp;quot;Interact&amp;quot; button if present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (interactButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if iframe is already present&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!iframe) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe = document.createElement('iframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.id = 'embeddedIframe';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.src = 'https://acp.analytica.com/view0?invite=4314&amp;amp;amp;code=2462049136540573676';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(iframe);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure maximize button is displayed&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!maximizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.id = 'maximizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.title = 'Click to use full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-maximize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.requestFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = &amp;quot;100%&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(maximizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Ensure minimize button is created&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;let minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (!minimizeButton) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.id = 'minimizeButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.title = 'Exit full screen';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.position = 'fixed';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.bottom = '10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.right = '110px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.background = 'transparent';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.width = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.height = '30px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundImage = 'url(&amp;quot;https://analytica.com/wp-content/uploads/2024/11/arrows-minimize.png&amp;quot;)';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundSize = 'contain';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.backgroundRepeat = 'no-repeat';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.style.display = 'none'; // Hidden initially&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minimizeButton.onclick = function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.exitFullscreen();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(minimizeButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Event listener to handle fullscreen changes&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('fullscreenchange', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const maximizeButton = document.getElementById('maximizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const minimizeButton = document.getElementById('minimizeButton');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const iframe = document.getElementById('embeddedIframe');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Check if in fullscreen mode&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (document.fullscreenElement) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;} else {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (maximizeButton) maximizeButton.style.display = 'block';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;if (minimizeButton) minimizeButton.style.display = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Restore iframe size when exiting fullscreen&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.width = '1210px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;iframe.style.height = '600px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;// Create the &amp;quot;Click to interact&amp;quot; button&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;document.addEventListener('DOMContentLoaded', function() {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const container = document.getElementById('container');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;const interactButton = document.createElement('button');&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.id = 'interactButton';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.textContent = &amp;quot;Click to interact with the model in Analytica Cloud Platform&amp;quot;;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.position = 'absolute';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.bottom = '13px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.right = '140px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.padding = '5px 10px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontSize = '16px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.fontWeight = 'bold';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.backgroundColor = '#d3d3d3';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.color = 'black';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.border = 'none';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.borderRadius = '5px';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.cursor = 'pointer';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.style.opacity = '0.9';&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;interactButton.onclick = function(event) {&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;event.stopPropagation();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;showIframe();&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;};&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;container.appendChild(interactButton);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;});&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/script&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;div id=&amp;quot;container&amp;quot; class=&amp;quot;screenshot-border&amp;quot; style=&amp;quot;position: relative; width: 100%; height: auto;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img id=&amp;quot;runImage&amp;quot; src=&amp;quot;https://analytica.com/wp-content/uploads/2023/07/ev-vs-ice-1.webp&amp;quot; width=&amp;quot;1210px&amp;quot; height=&amp;quot;648px&amp;quot; onclick=&amp;quot;showIframe()&amp;quot; style=&amp;quot;cursor: pointer;&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;amp;lt;/div&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
'''&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;Coming...this section is under construction.&amp;lt;/font&amp;gt;'''--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Analytica Cloud Player]]&lt;br /&gt;
* [[Example Models]]&lt;br /&gt;
* [[Tutorial: Sharing a model with ACP]]&lt;br /&gt;
* [[Model Licensing]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=IndexesOf&amp;diff=61806</id>
		<title>IndexesOf</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=IndexesOf&amp;diff=61806"/>
		<updated>2024-11-19T00:06:36Z</updated>

		<summary type="html">&lt;p&gt;Max: /* IndexesOf(a, except...) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Functions that create lists]]&lt;br /&gt;
[[Category:Functions returning information about arrays]]&lt;br /&gt;
[[Category:Meta-Inference Functions]]&lt;br /&gt;
&lt;br /&gt;
== IndexesOf(a'', except...'') ==&lt;br /&gt;
Returns a list of [[handle]]s to the indexes of array «a». It is different from [[IndexNames]](a), which returns the identifiers of the indexes as text values instead of handles.  &lt;br /&gt;
&lt;br /&gt;
If «X» has an [[implicit index]] (an index without a name), the first element of the output list is [[null]], rather than a handle.&lt;br /&gt;
&lt;br /&gt;
If the array has more than one [[Local Indexes|local index]] with the same identifier, you can use [[IndexesOf]](a) to identify each index safely because each handle unambiguously refers to the corresponding index, where [[IndexNames]](a) would return the identifiers as identical and therefore ambiguous text values.&lt;br /&gt;
&lt;br /&gt;
The optional «except» parameter excludes any of the indexes that are listed.&lt;br /&gt;
&lt;br /&gt;
[[Syntax]]: &lt;br /&gt;
:[[IndexesOf]](a: Array)&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
:&amp;lt;code&amp;gt;IndexesOf(Car_prices) &amp;amp;rarr; [Car_types, Year]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;IndexesOf(Car_prices, except: Car_types) &amp;amp;rarr; [Year]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Find the maximum in &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; over all indexes:&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Max]]( A, ...[[IndexesOf]](A) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sum over all indexes of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; except &amp;lt;code&amp;gt;J&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;K&amp;lt;/code&amp;gt;:&lt;br /&gt;
:&amp;lt;code&amp;gt;[[Sum]]( x, ...[[IndexesOf]](x, except: J,K) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
* The «except» parameter was introduced in [[Analytica 5.2]].&lt;br /&gt;
&lt;br /&gt;
== See Also == &lt;br /&gt;
* [[Handle]]&lt;br /&gt;
* [[Handle Functions]]&lt;br /&gt;
* [[IndexNames]]&lt;br /&gt;
* [[Repeated parameter forwarding]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=AcpStyles&amp;diff=61248</id>
		<title>AcpStyles</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=AcpStyles&amp;diff=61248"/>
		<updated>2024-08-02T22:30:37Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Hide the Save options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Analytica Cloud Platform]]&lt;br /&gt;
[[Category: Attributes]]&lt;br /&gt;
[[Analytica_Cloud_Player#See_also|Analytica Cloud Platform &amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
::{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
ACP offers a wide variety of styles and options to control the look and functioning of the user interface. Many of these go beyond what is (currently) available in Desktop Analytica (DTA). &lt;br /&gt;
&lt;br /&gt;
The easiest way to set most of these styles and options is to use the [[ACP Style Library]].  This library lets you interactively select most ACP styles and options for Navigation, Frames and results using menus and checkboxes and menus. As you change styles in ACP, you can see their effects immediately. &lt;br /&gt;
&lt;br /&gt;
If you use [[ACP Style Library]] you don't need to learn about the ACP Styles described below. This page is only needed if you want to do something esoteric with AcpStyles, or use those few AcpStyles not (yet) accessible in the [[ACP_Style_Library]]. &lt;br /&gt;
&lt;br /&gt;
You set general styles and options that apply to the whole model by adding flags to the AcpStyles  attribute for the main model. You set styles specific to a particular module or node by adding flags to the AcpStyles  attribute for that object. &lt;br /&gt;
 &lt;br /&gt;
The easiest way to view and edit the AcpStyles  attribute in Desktop Analytica is to use the [[Attribute panel]].  Select AcpStyles  from the list of Attributes at the top of that panel. By default, AcpStyles is not shown in the [[Object window]], so you first need to set it to be shown either with the [[Object_Window|right click menu]] in the Object window, or in the [[Manage attributes|Attributes dialog]].  &lt;br /&gt;
&lt;br /&gt;
The AcpStyles  and their flags are not case sensitive.  &lt;br /&gt;
&lt;br /&gt;
When you put multiple flags in a AcpStyles attribute, put each flag on a separate line. &lt;br /&gt;
&lt;br /&gt;
== Model level styles  ==&lt;br /&gt;
&lt;br /&gt;
These styles apply to the entire model. You set them in the AcpStyles attribute for the Main Model. (They have no effect when set for a submodule.)&lt;br /&gt;
&lt;br /&gt;
=== Navigation style  ===&lt;br /&gt;
&lt;br /&gt;
These Navigation_style options control how a user can view and access the module hierarchy:&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Navigation_style: Outline&amp;lt;/code&amp;gt;''' -- Show an expandable tree of modules on the left of the ACP window, similar to the outline view in desktop Analytica (showing only modules not other objects). This is the default style when you upload a model with no ACP styles set or no Acp styles library embedded, or if you have not yet set the Navigation style in the Acp styles library. A navigation flag is not needed for this style, but if you want to explicitly set this style you can add '''&amp;lt;code&amp;gt;Navigation_style: Outline&amp;lt;/code&amp;gt;''' to the top diagram's AcpStyles attribute.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Navigation_style: Top diagram only&amp;lt;/code&amp;gt;''' -- Show only the top diagram, with no Outline and no tabs. This lets you make a simple web application with a single UI page.  &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the next two  'Tabbed application' styles, each module in the main model becomes a tab. The order of the tabs follows the sequence of the module nodes in the main diagram, from  left to right then top to bottom. &lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;Navigation_style: Top_tabs&amp;lt;/code&amp;gt;''' -- The main modules in the top model appear as a row of tabs across the top of the window. Click a tab to show the diagram for that module. &lt;br /&gt;
&amp;lt;!--Remove for now* '''&amp;lt;code&amp;gt;Navigation_style: Two_top_tabs&amp;lt;/code'''&amp;gt; --  The main modules in the top model appear as a row of tabs. The submodules of the module whose tab is selected appear as a second row of tabs. Needs to be used with the style'''&amp;lt;code&amp;gt;show_as_tab: no&amp;lt;/code&amp;gt;'''. --&amp;gt;&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Navigation_style: Side_tabs&amp;lt;/code&amp;gt;''' -- The main modules in the top model appear as a column of tabs on the left of the window. Click a tab to show the diagram for that module.&lt;br /&gt;
&amp;lt;!--Remove for now * '''&amp;lt;code&amp;gt;Navigation_style: Two_side_tabs&amp;lt;/code&amp;gt;'''  -- The top tabs reflect the main modules in the top model. Clicking a top tab shows a a set of subtabs, reflecting the submodules of main module (tab) selected. Needs to be used with the style '''&amp;lt;code&amp;gt;show_as_tab: no&amp;lt;/code&amp;gt;'''.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We describe each in more detail below.&lt;br /&gt;
&lt;br /&gt;
===Outline Tree===&lt;br /&gt;
&lt;br /&gt;
By default, when using the Outline Navigation style, ACP shows an expandable outline tree of modules on the left hand side of the window, similar to the Outline view in Analytica on the desktop. This makes it easy to navigate a model with an extensive hierarchy of modules. &lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_outline: yes&amp;lt;/code&amp;gt;''' -- The default, and unecessary for Outline Navigation style. It is generally redundant with other Navigation styles since the tabs or hierarchy show the same information, and the Outline takes up screen space. But you can add  it to the top diagram's AcpStyles attribute if you want to show the Outline tree with other Navigation styles.&lt;br /&gt;
&lt;br /&gt;
{{CalloutAnnotationBlock|[[File:Outline tree 6.0 01.png]]|{{CalloutAnnotation|Market model with&amp;lt;br&amp;gt;Outline Tree|v=80|pt=10,106}}}}&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_outline: no&amp;lt;/code&amp;gt;''' --  When using the Acp Style library this is set by default for Navigation styles other than Outline. For small models, and most web apps, you may want to suppress the Outline view even when using the Outline Navigation style. Do this by inserting this text into the top diagram's AcpStyles attribute (See image below). (If a model has only one diagram,  i.e. with no modules, it never shows the outline tree.)&amp;lt;br/&amp;gt;&lt;br /&gt;
{{CalloutAnnotationBlock|[[File:Outline tree 6.0 02.png]]|{{CalloutAnnotation|Market model with &amp;lt;br/&amp;gt;'''&amp;lt;code&amp;gt;show_outline: no&amp;lt;/code&amp;gt;'''|v=80}}}}&lt;br /&gt;
&lt;br /&gt;
===Top Diagram Only===&lt;br /&gt;
&lt;br /&gt;
Set by adding '''&amp;lt;code&amp;gt;navigation_style: top_diagram_only&amp;lt;/code&amp;gt;''' to the AcpStyles attribute of the top diagram. &amp;lt;!--Not to be confused with the AcpStyles flag of similar name: '''&amp;lt;code&amp;gt;top_diagram_only: yes&amp;lt;/code&amp;gt;'''. -This is a navigation style most easily set with the ACP styles library. --&amp;gt; The Styles library will set the flag &amp;lt;!--'''&amp;lt;code&amp;gt;top_diagram_only:yes&amp;lt;/code&amp;gt;''',--&amp;gt; '''&amp;lt;code&amp;gt;show_outline:no&amp;lt;/code&amp;gt;''' .&lt;br /&gt;
&lt;br /&gt;
===Tabbed Module Navigation===&lt;br /&gt;
&lt;br /&gt;
As an alternative to the Outline view, you can set the '''&amp;lt;code&amp;gt;Navigation_style&amp;lt;/code&amp;gt;''' to use use a tabbed interface which is often more convenient and familiar for web applications. By default, the main model appears as the first tab. You can change this with the style [[AcpStyles_Attribute_Values#Exclude_the_top_level_diagram_from_tabs|show_as_tab:no]] described below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Replace this section with one that does not talk about two tabs for now - until they are implemented in ACP3 - There are four tabbed styles, Top_tabs and Two_top_tabs, with one or two rows of tabs across the top, respectively; and Side_tabs and Two_side_tabs with one or two columns of tabs down the side. Top_tabs works well if you have up to 5 to 8 modules in the main diagram (tabs), depending on the length of their titles and the width of the ACP window.  If you have a lot of modules, or they have long titles, it may be better to use Side_tabs.  If you have too many modules to fit at the top or side, you can use Two_top_tabs or Two_side_tabs. In those cases, you must organize the modules into a two-level hierarchy with logical groupings. &lt;br /&gt;
&lt;br /&gt;
'Top tabs or side tabs.' The first tab displays the top level diagram, and the remaining tabs display the modules present on the top level diagram of the model.  (The modules will not display on the diagram, so you need to tweak your diagram for playing in ACP so that it looks right without these present). The size of the diagram is determined by the size of the top level diagram window when the model was last saved in Analytica.&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;navigation_style: top_tabs&amp;lt;/code&amp;gt;''' This setting instructs ACP to use the 'Tabs across top' navigation style.&lt;br /&gt;
&lt;br /&gt;
:[[File:Top tabs 6.0 01.png]]&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;navigation_style: side_tabs&amp;lt;/code&amp;gt;''' This setting instructs ACP to use the 'Side tabs' navigation style.  Side tabs work better than top tabs when there are more module nodes present.&lt;br /&gt;
&lt;br /&gt;
:[[File:Side tabs 6.0 01.png]]&lt;br /&gt;
* &amp;lt;code&amp;gt;Navigation_style: Two_top_tabs&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;Navigation_style: Two_side_tabs&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''These 2 Navigation styles replace the style  &amp;lt;code&amp;gt;two_tiers_tabs:yes&amp;lt;/code&amp;gt; which has been deprecated.'''&lt;br /&gt;
&lt;br /&gt;
These styles are useful for modules with several layers of modules and submodules - to reduce the clutter of the top layer of tabs. Modules in the model's top diagram appear as top tabs (left tabs).  Modules within those top level modules appear as subtabs,  the 'second tier'. When you select a top-level tab, it shows its submodules as subtabs. This means that the top level of modules will not show any contents other than their submodules, so the model needs to be designed with this in mind.&lt;br /&gt;
*Currently these 2 styles must be used with the '''&amp;lt;code&amp;gt;show_as_tab: no&amp;lt;/code&amp;gt;''' style set. &amp;lt;!--Coming soon: Compatibility with '''&amp;lt;code&amp;gt;show_as_tab: yes&amp;lt;/code&amp;gt;'''&lt;br /&gt;
*The selected tab appears with the color of the diagram background of it's module&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
There are two tabbed styles, Top_tabs, with a row of tabs across the top; and Side_tabs with a column of tabs down the side. Top_tabs works well if you have up to 5 to 8 modules in the main diagram (tabs), depending on the length of their titles and the width of the ACP window.  If you have a lot of modules, or they have long titles, it may be better to use Side_tabs.  &lt;br /&gt;
&lt;br /&gt;
'Top tabs or side tabs.' The first tab displays the top level diagram, and the remaining tabs display the modules present on the top level diagram of the model.  (The modules will not display on the diagram, so you need to tweak your diagram for playing in ACP so that it looks right without these present). &lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;navigation_style: top_tabs&amp;lt;/code&amp;gt;''' -- This setting instructs ACP to use the 'Tabs across top' navigation style.&lt;br /&gt;
&lt;br /&gt;
[[File:Top tabs 6.0 01.png]]&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;code&amp;gt;navigation_style: side_tabs&amp;lt;/code&amp;gt;''' -- This setting instructs ACP to use the 'Side tabs' navigation style.  Side tabs work better than top tabs when there are more module nodes present.&lt;br /&gt;
&lt;br /&gt;
[[File:Side tabs 6.0 01.png]]&lt;br /&gt;
&lt;br /&gt;
=== Toolbar Tabs ===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_tabs: no&amp;lt;/code&amp;gt;''' -- By default, with the Outline Navigation style. ACP shows navigation tabs for &amp;quot;Diagram&amp;quot;, &amp;quot;Object&amp;quot;, &amp;quot;Table&amp;quot;, &amp;quot;Graph&amp;quot; along the top. Use this flag to hide those tabs. If you display the model inputs and outputs on the diagram -- using embedded tables and graphs on the diagram -- your users may not need those tabs.  (You can also use '''&amp;lt;code&amp;gt;show_tabs: yes&amp;lt;/code&amp;gt;''' to explicitly show the tabs in Outline and Top diagram only Navigation styles.) &lt;br /&gt;
{{CalloutAnnotationBlock|[[File:Show tabs no 6.0 0.1.png]]|{{CalloutAnnotation|Market model with &amp;lt;br/&amp;gt;'''&amp;lt;code&amp;gt;show_tabs: no&amp;lt;/code&amp;gt;'''|v=80|pt=232,37|path=t!-}}}}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module hierarchy bar ===&lt;br /&gt;
Using tabbed navigation, ACP shows the model hierarchy in a bar at the top of the diagram by default. The model hierarchy header shows you where you are in a large model by listing the titles of the ancestor modules in which the current diagram is nested.  You can click any ancestor to click up levels in the hierarchy. The Hierarchy Bar takes up much less screen real estate than the Outline Tree. ACP doesn't show the hierarchy bar when you are viewing a top level module, or if the module title is already in the selected tab. &amp;lt;!--With a two-level tab navigation, it shows the hierarchy bar only when viewing a module nested 3 or more levels down. Basically, the hierarchy header does not duplicate what you can see in the tabs.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this setting is not based on a AcpStyles attribute, but rather on the ''Show module hierarchy'' check box in the model [[Preferences]] in Analytica.  If you want to set this preference manually, with the model opened in Analytica, on the [[Edit menu]], select '''Preference...''', and check (or uncheck) the ''Show module hierarchy'' checkbox. &lt;br /&gt;
&lt;br /&gt;
If you are using the ACP styles library, the Styles library will set this to the default setting automatically once you select a Navigation style. But you have the option of changing it if, for instance you want to show the Outline and the Hierarchy bar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--:[[Image:Acp hh.png]]--&amp;gt;&lt;br /&gt;
===Auto zoom ===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;auto_zoom_diagrams: yes&amp;lt;/code&amp;gt;''' -- ACP automatically zooms the UI to fit the browser window -- the most constraining of width or height so it retains the aspect ratio of the diagram. Works with zoom in and zoom out. This Acp style has no effect if '''&amp;lt;code&amp;gt;Use_top_diagram_size:Yes &amp;lt;/code&amp;gt;''' is present, you can use only one or the other. You can also set '''&amp;lt;code&amp;gt;auto_zoom_diagrams: no&amp;lt;/code&amp;gt;''' which is the default.&lt;br /&gt;
&lt;br /&gt;
===Use top diagram size for all ACP windows===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Use_top_diagram_size:Yes &amp;lt;/code&amp;gt;''' --  Sets the size of all diagrams based on the size of the diagram window of the top level when the model was last viewed in Desktop Analytica (in non-maximized mode).  '''&amp;lt;code&amp;gt;Use_top_diagram_size:No &amp;lt;/code&amp;gt;''' is the same as if the flag is not set, and is the default  - the ACP diagram will use the entire browser window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Not in ACP3 yet - ER519&lt;br /&gt;
===Display Only a Single Diagram===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;top_diagram_only: yes&amp;lt;/code&amp;gt;''' -- Use this flag if you want to restrict users access to only the top diagram. With this flag, any action that would normally bring up a different diagram will just reload the top diagram.  (If you are using this setting, you will also want to also not display the Outline Tree as explained above, since clicking on the modules in the Outline will have no effect.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Show or hide the Dashboard Title and Model title===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_model_title: no&amp;lt;/code&amp;gt;''' -- Hide the title of the model, which appears by default in the top Teal bar.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_diagram_title: yes&amp;lt;/code&amp;gt;''' --  Use  to show the dashboard title at the top of the diagram. Or &amp;lt;code&amp;gt;show_diagram_title: no&amp;lt;/code&amp;gt; to suppress the diagram title, but not really necessary because ACP does not show the diagram title by default.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
===Hide the Banner and Logo===&lt;br /&gt;
Another flag it's easier to use the [[ACP Style Library]] to set, since it is only compatible with the toolbar tabs hidden. The Styles library changes all the flags at once, and prevents you from entering incompatible combinations.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_banner: no&amp;lt;/code&amp;gt;''' &lt;br /&gt;
::Hides the banner space usually present at the top of ACP. The banner typically contains the Lumina Logo, the '''Parent Diagram''' button, tabs, '''Close Model''' button, and '''Save''' button.&lt;br /&gt;
&lt;br /&gt;
:*This could be useful for customizing the appearance of a model [[Putting_ACP_in_a_Web_Page|embedded in a web page]], for instance.&lt;br /&gt;
:[[File:Banner area 01.PNG]]&lt;br /&gt;
:*If you play a model without the banner area in ACP, there isn't a convenient way to close the model without closing the browser.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Exclude diagram(s) from tabs===&lt;br /&gt;
&lt;br /&gt;
When using tabbed navigation, you can select those modules (from the top model diagram) that you want to appear as a tab in ACP. The default is for all to appear as tabs. You should use the ''Show modules as tabs'' choice menu in the '''&amp;lt;code&amp;gt;ACP Navigation styles&amp;lt;/code&amp;gt;''' section of the [[ACP Style Library]] if you want to set this flag,, and if you also want to hide the modules corresponding to these tabs [[ChangeNodeVisibility|hidden]], so that the model viewer cannot see them.&lt;br /&gt;
&lt;br /&gt;
*Optionally, Enter the text '''&amp;lt;code&amp;gt;Show_as_tab: no&amp;lt;/code&amp;gt;''' in the AcpStyles attribute of the modules you don't wish to show as a tab. The modules themselves will not be hidden with this setting, only the tabs.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_as_tab: no&amp;lt;/code&amp;gt;''' &lt;br /&gt;
::Excludes the top level diagram and just shows the submodules of the top level diagram as tabs. Since the top diagram will not display in ACP, you include the key user interface pages as modules in the main model. Can be used only with 'Top tabs' or 'Side tabs' styles. &lt;br /&gt;
*When setting tabbed Navigation styles using the ACP Styles Library, the default is for the Top level diagram to be included, except with two tiers of tabs, for which it is (Currently) required to exclude the top diagram from the tabs.&lt;br /&gt;
&lt;br /&gt;
If you want to see what it looks like, play this model [[Media:Show as tab no.ana|Array examples]] in ACP, with the '''&amp;lt;code&amp;gt;show_as_tab: no&amp;lt;/code&amp;gt;''' style in the AcpStyles  attribute, and set to tabs along top.&lt;br /&gt;
&lt;br /&gt;
:[[File:Show as tab no02.png]]&lt;br /&gt;
&lt;br /&gt;
*Play this model in ACP and the top level diagram does not show. Rather the diagram for 'Intro to Arrays' shows as the first tab and then the other tabs.'''&lt;br /&gt;
&lt;br /&gt;
:[[File:Show as tab no01.png]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Tab color===&lt;br /&gt;
&lt;br /&gt;
When using Tabbed Navigation, you can use these flags to control how the color of the tabs display on your model in ACP. To use, add one of them to the AcpStyles attribute of the top level diagram of your model. They have no effect if added to a module other than the top diagram.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Tab_color: Default &amp;lt;/code&amp;gt;''' The default. Non-selected tabs are bluish white. The selected tab uses the background color for that diagram.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Tab_color: Background &amp;lt;/code&amp;gt;''' All tabs use their diagram background color, whether selected or not&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Tab_color: Node &amp;lt;/code&amp;gt;'''  The selected Tab uses its diagram background color; The other tabs use the color of their Module node (not their diagram background color).  You can use this to change the color of the tabs by modifying their node color in an Analytica functions.&lt;br /&gt;
&lt;br /&gt;
== Model level styles for diagram nodes. ==&lt;br /&gt;
&lt;br /&gt;
These model-level styles affect how all nodes are displayed in diagrams.  &lt;br /&gt;
&lt;br /&gt;
=== Node shadows and bevels  ===&lt;br /&gt;
&lt;br /&gt;
By default ACP displays nodes without shadows or bevels (for now) , so they look like this:&lt;br /&gt;
:[[Image:Nodes no shadow or bevel.png]] &lt;br /&gt;
&lt;br /&gt;
Set this flag to show a drop shadow behind each node, giving a kind of 3D effect:&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;node_drop_shadow: yes&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
:[[Image:Nodes drop shadow.png]] &lt;br /&gt;
&lt;br /&gt;
Set this flag to display a bevel border for each node, giving another kind of 3-D effect: &lt;br /&gt;
*'''&amp;lt;code&amp;gt;bevel_node_border: yes&amp;lt;/code&amp;gt;''' &lt;br /&gt;
&lt;br /&gt;
:[[Image:Nodes beveled border.png]] &lt;br /&gt;
&lt;br /&gt;
===Node hover highlighting===&lt;br /&gt;
&lt;br /&gt;
By default, ACP displays a highlight -- a contrasting light rectangle behind a node -- when you move the cursor over the node:&lt;br /&gt;
&lt;br /&gt;
[[File:acp hover hl.png]]&lt;br /&gt;
&lt;br /&gt;
You can switch it off by setting:&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_hover_highlight: No&amp;lt;/code&amp;gt;''' &lt;br /&gt;
&lt;br /&gt;
=== Balloon Help  ===&lt;br /&gt;
&lt;br /&gt;
When you move the cursor over a node, ACP usually shows a &amp;quot;balloon&amp;quot; popup next to the node with the description of the node (if it has one) to help end users understand what its for, or what to enter for a user input. If the node has no description, the [[help balloons|balloon help]] will not appear.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_id_in_balloon: yes&amp;lt;/code&amp;gt;''' Use this flag to show each node's identifier below its title in the balloon -- unless the identifier and title are identical (except for spaces which are replaced by underscores). This flag goes in the AcpStyles of the model and apply to all nodes in the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- not implemented in ACP3 &lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_definition_in_balloon: yes&amp;lt;/code&amp;gt;''' &lt;br /&gt;
::Use this flag to show the node's definition in the balloon below the description.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- not implemented in ACP3 &lt;br /&gt;
*'''&amp;lt;code&amp;gt;hover_balloon_delay&amp;lt;/code&amp;gt;''' &lt;br /&gt;
::When you mouse over a node, there's a short delay of about half a second before it displays the balloon (to prevent wild balloon appearance when you move the cursor rapidly over a diagram.) You can tweak this delay time measured in milliseconds by inserting this flag. E.g. '''&amp;lt;code&amp;gt;hover_balloon_delay: 200&amp;lt;/code&amp;gt;''' to reduce the delay to .2 seconds.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The flags above go in the AcpStyles of the model and apply to all nodes in the model. You can also modify some aspects of the balloon separately for each node by inserting these flags in AcpStyles for each node: --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_hover_balloon: no&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::Insert this flag in the AcpStyles for a node, to suppress display of its balloon.&lt;br /&gt;
&amp;lt;!--title no longer shows in the baloon&lt;br /&gt;
*'''&amp;lt;code&amp;gt;show_hover_balloon_title: no&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::Insert this flag in the AcpStyles for a node, to suppress its title in the balloon.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ACP styles inheritance==&lt;br /&gt;
This is the order of inheritance for Acpstyles below that apply to tables and graphs. Styles at a higher level take precedence over the lower precedence styles. (Inheritance doesn't apply to the ACPstyles described above that apply only at the Model level.)&lt;br /&gt;
# '''Variable''' (includes Tall nodes): Acpstyles applied to an individual variable will take precedence over all other styles. A variable with a style of &amp;lt;code&amp;gt;show_title:no&amp;lt;/code&amp;gt; will not show the title, even if the model level style is &amp;lt;code&amp;gt;show_title:yes&amp;lt;/code&amp;gt;, and if that node shows it's result in a frame node the variable style will override the frame node style.&lt;br /&gt;
# '''Frame''' : An Acpstyle set for a frame node will affect any variable shown in that frame that doesn't have its own settings. These will also override any styles at the model level.&lt;br /&gt;
# '''Model ACP style defaults''': Acpstyles that you can enter into the Acptyles attribute of the top diagram of your model. These will override the ACP defaults, and will be inherited by frame nodes and variables in the model that don't have their own Acpstyle.&lt;br /&gt;
# '''ACP style defaults for ACP''': The default style ACP uses if you have no specific setting for that style. Eg for show_index_menus the default is fly-in and that is what will show if you don't enter a different show_index_menus: Acpstyle flag in the Acpstyle for the top diagram (model level) or for frame nodes or variables.&lt;br /&gt;
&lt;br /&gt;
==ACP Styles for tables and graphs==&lt;br /&gt;
&lt;br /&gt;
These styles affect how result graphs and tables are displayed in ACP, including in [[Embed_table_or_graph_with_ACP#Frame_nodes|Tall nodes]] and [[Embed_table_or_graph_with_ACP#Tall_nodes|˞Frame nodes]]. They provide options not (yet) available in Desktop Analytica. ACP has default settings for these. You can override these settings for the entire model. You can also set them for [[Embed_table_or_graph_with_ACP#Frame_nodes|˞Frame nodes]], which will apply to all results shown in the Frame and override the ACP and model level settings. And you can set these styles for individual variables, which will override any settings in the Model or Frame. As always, it's easiest to set the using the [[ACP_Style_library]]. &lt;br /&gt;
&lt;br /&gt;
None of these styles apply to tab result views using the default Navigation_style: Outline.&lt;br /&gt;
&lt;br /&gt;
===Show or hide the Description===&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_description: nn&amp;lt;/code&amp;gt;'''' Where &amp;lt;code&amp;gt;nn&amp;lt;/code&amp;gt; is a number between 0 and 100, where it uses up to nn% of the vertical space available to show the description. If that isn't enough to show the entire description, it shows a vertical scroll bar. Set &amp;lt;code&amp;gt;nn = 0&amp;lt;/code&amp;gt;, if you don't want to show the description at all. Default if not mentioned, is one third, i.e. &amp;lt;code&amp;gt;Show_description: 33&amp;lt;/code&amp;gt;.  This style can be used at the model level, for frame nodes or for individual nodes, but controls  whether or not the Description shows in tall nodes or Frame nodes. &lt;br /&gt;
&lt;br /&gt;
===Show or hide the Object view icon===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Object_in_Frame:yes/no&amp;lt;/code&amp;gt;''': With this style set, it shows an object view hover icon at the top right of a frame node or tall node when showing a graph or table view. Click this icon to show the object window view. The object view shows the Table and Graph hover icon to go back to the table or graph view.  You can set '''&amp;lt;code&amp;gt;Object_in_frame&amp;lt;/code&amp;gt;''' style at either the top level of the model or in an individual frame node, which overrides the top level setting. When working with tall nodes, you can set '''&amp;lt;code&amp;gt;Object_in_frame&amp;lt;/code&amp;gt;''' style at the top level or in the original variable's ACP style setting, which overrides the top level setting.&lt;br /&gt;
&lt;br /&gt;
===Show or hide the title===&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_title&amp;lt;/code&amp;gt;''': Set &amp;lt;code&amp;gt;Show_title: yes&amp;lt;/code&amp;gt; to show or &amp;lt;code&amp;gt;Show_title: no&amp;lt;/code&amp;gt; to stop showing the Title and units of a selected variable. This style can be used at the model level, for frame nodes or for individual nodes, but controls  whether or not the Title and units show in Frame nodes or tall nodes. &lt;br /&gt;
&lt;br /&gt;
===Show or hide the Graph-Table icon===&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_graph_table_icon:no&amp;lt;/code&amp;gt;''' Hides the icon in the top right of a Result that lets you toggle between Graph and Table view. This applies to [[Embed_table_or_graph_with_ACP|Frame nodes and tall nodes]]. This style can be used for  the entire model, for frame nodes or for individual nodes . You set them in the AcpStyles attribute.  Conversely, you can set  '''&amp;lt;code&amp;gt;Show_graph_table_icon:yes&amp;lt;/code&amp;gt;'''. This is the default so not usually necessary at the model level, but can be used in a frame node or variable to override the model default or override a frame node setting.&lt;br /&gt;
&lt;br /&gt;
===Show or hide the Uncertainty view menu===&lt;br /&gt;
By default, in ACP, as in desktop Analytica, the [[Uncertainty views]] menu appears above each result graph or table to let you select [[Mid]] to display its deterministic value, or Mean, Probability distribution, and other ways to display a probabilistic value.  &lt;br /&gt;
&lt;br /&gt;
You can override this default behavior with this ACP style for the entire model, [[Embed_table_or_graph_with_ACP#Frame_nodes|Frame nodes]], or for individual variables. The Uncertainty view menu is always present in tab result views.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_uncertainty_view: No&amp;lt;/code&amp;gt;''' Never show the uncertainty menu in frame nodes or tall result nodes. Suitable for models with no probabilistic values, or if you want to fix a particular probabilistic view for each frame node or variable so that ACP users can't change it.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_uncertainty_view: Yes&amp;lt;/code&amp;gt;''' Always show the uncertainty menu even for variables that are not probabilistic, as in Desktop Analytica. This is the default and not normally necessary at the model level, but can be used to customize which frame nodes or variables to show the uncertainty view menu when the model level style is set to '''&amp;lt;code&amp;gt;Show_uncertainty_view: No&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
===Show or hide the Index menus and Pivoters/slicers===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_index_menus: Fly-in&amp;lt;/code&amp;gt;''' By default (the same as if there is no show_index_menu: setting) the index menus are not shown in [[https://wiki.analytica.com/index.php?title=Embed_table_or_graph_with_ACP|frame nodes or tall nodes]] (but slicers are), since often the modeler has already chosen the pivot they want to use. And because these menus take up valuable screen space. But if you hover over the frame node (or tall node) there is a fly-in pivoter control. If you click this it toggles - on or off - the visibility of the pivoters; allowing you to pivot the result table or graph and then close the pivoters to give you more space.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_index_menus: Yes&amp;lt;/code&amp;gt;''' If you do want to allow users to be able to pivot or change the slice of the table or graph, without using the fly-in, then use use show_index_menus:yes. Always present in tab result views.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_index_menus: No&amp;lt;/code&amp;gt;''' If show_index_menus:no is set then the indexes and pivoters will not show and there is no fly-in, but the slicers will still be present.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_index_menus: Not_even_slicers&amp;lt;/code&amp;gt;''' If you don't want to show any pivoters or slicers, you can set show_index_menus:Not_even_slicers.&lt;br /&gt;
&lt;br /&gt;
===Autocalc===&lt;br /&gt;
&lt;br /&gt;
In the  [[ACP Style Library]], Autocalc looks like a style you can set for a model, module or variable. It controls whether ACP evaluates each variable and shows its results automatically when you view a Diagram or tab showing the -- instead of the default Analytica behavior where the end user has to click on a Calc button to compute a result.  With Autocalc on, a result in view also recomputes automatically when you change an input that influences it.&lt;br /&gt;
&lt;br /&gt;
Autocalc is not actually an ACPStyle in ACP3. (It was in ACP1.)  Autocalc is implemented using the Desktop Analytica functionality  for [[Proactive_Evaluation]].&lt;br /&gt;
&lt;br /&gt;
== Node Level Settings  ==&lt;br /&gt;
&lt;br /&gt;
These style flags and options apply to individual nodes (variables), rather than the model as a whole. So, you set these flags on the AcpStyles for selected objects (nodes).&lt;br /&gt;
&lt;br /&gt;
=== Other node level flags ===&lt;br /&gt;
=== Prevent nodes from showing on the diagram ===&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Show_Object: no&amp;lt;/code&amp;gt;''' &lt;br /&gt;
You can prevent nodes or modules from showing on the diagram of your model, by adding this flag to the AcpStyles attribute of the object you wish to hide. Once the model is shown in ACP the objects aren't visible.&lt;br /&gt;
&lt;br /&gt;
== Modifying ACP menus==&lt;br /&gt;
&lt;br /&gt;
Normally, ACP offers menus that appear when you press one of the three icons on the right of the top teal bar. These ACP styles let you modify these menus.&lt;br /&gt;
&lt;br /&gt;
===Hide the Save options===&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Hide_save_button: yes &amp;lt;/code&amp;gt;''' Set this model ACP style option to exclude the  'Save this model' and 'Save model as...' from the ACP Close menu. It prevents  users from saving over your models or saving other versions.&lt;br /&gt;
&lt;br /&gt;
===Remove Help menu items===&lt;br /&gt;
&lt;br /&gt;
These styles add menu items to or remove items from the help (?) menu if added to the AcpStyles of the top diagram of your model. For [[ACP_Server_License|ACP installations]]  on an intranet, these standard links may not be accessible. On the other hand you may want to offer a special help page for a particular model.&lt;br /&gt;
&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Remove_help_menu_options: Text&amp;lt;/code&amp;gt;&lt;br /&gt;
This style allows you to list one or more of the standard options to remove from the help (?) menu. Replace &amp;lt;code&amp;gt;Text&amp;lt;/code&amp;gt; with one or more of the following: &amp;lt;code&amp;gt;ACP_Online_docs, Analytica_Q_A_forum, Tech_support&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
(Note: The help menu item &amp;lt;code&amp;gt;Connection status&amp;lt;/code&amp;gt; cannot currently be removed).&lt;br /&gt;
&lt;br /&gt;
===Add Help menu item===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;Add_help_menu_option: Text|URL&amp;lt;/code&amp;gt;''' &lt;br /&gt;
Adds another menu item, for example: &amp;lt;code&amp;gt;Add_help_menu_option: How to use this model...|https://www.lumina.com&amp;lt;/code&amp;gt; adds a menu item to the help (?) menu with the text &amp;quot;How to use this model...&amp;quot; and opens the link when clicked.&lt;br /&gt;
&lt;br /&gt;
===Add download this model to the Close menu===&lt;br /&gt;
*'''&amp;lt;code&amp;gt;save_menu_download: yes&amp;lt;/code&amp;gt;'''&lt;br /&gt;
This AcpStyle is controlled by a setting in the [[Customizing_an_ACP_server#The_acpConfig.json_file|AcpConfig.json]] file. On Lumina's acp.analytica.com server it is turned on.&lt;br /&gt;
With this AcpStyle in the model, ''&amp;lt;code&amp;gt;&amp;quot;download this model&amp;quot;&amp;lt;/code&amp;gt;'' is added to the close menu at the top right of the ACP GUI.&lt;br /&gt;
When set, this will allow anyone to download the model - even a reviewer, and even from an email invite.&lt;br /&gt;
*'''&amp;lt;code&amp;gt;save_menu_download: no&amp;lt;/code&amp;gt;''' (default if not set)&lt;br /&gt;
*'''&amp;lt;code&amp;gt;save_menu_download:Prompt_to_download_free&amp;lt;/code&amp;gt;'''.  This adds a popup dialog with a download link and prompt to download the Analytica free installer.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ACP Style Library]] &lt;br /&gt;
* [[media:ACP style library.ana]]&lt;br /&gt;
* [[Analytica Cloud Platform]]&lt;br /&gt;
* [[ACP Rendering tables and graphs on the diagram]]&lt;br /&gt;
* [[Putting ACP in a Web Page]]&lt;br /&gt;
* [[Help balloons]]&lt;br /&gt;
* [[Attributes]]&lt;br /&gt;
* [[Manage attributes]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Keyboard_Shortcuts&amp;diff=61178</id>
		<title>Keyboard Shortcuts</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Keyboard_Shortcuts&amp;diff=61178"/>
		<updated>2024-07-16T00:20:34Z</updated>

		<summary type="html">&lt;p&gt;Max: remove long obsolete arrow mode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Ana: Status M]]  &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like most applications, Analytica offers keys or key combinations as shortcuts to access common features. Some, like ''ctrl+v'' to paste, or ''ctrl+s'' to '''s'''ave a model file, are common to most Windows applications.  Learning some of these can greatly speed up your interactions. &lt;br /&gt;
&lt;br /&gt;
You can see the keyboard shortcuts for Toolbar icon buttons in the tooltip that appears when you move the mouse cursor over each icon,  for menu options inside each menu at the top of the application, and for context-dependent menu that appears when you right-click. &lt;br /&gt;
&lt;br /&gt;
==Most valuable shortcuts==&lt;br /&gt;
&lt;br /&gt;
These are the most useful shortcuts to learn initially (beyond the standard shortcuts common to most Windows applications):&lt;br /&gt;
* ''CTRL+F'': Open the [[Find dialog]]&lt;br /&gt;
* ''CTRL+H'': Select a variable or function identifier in a definition, and press ''ctrl+H'' to open its Object view&lt;br /&gt;
* ''CTRL+R'': Select a node and see its result view&lt;br /&gt;
* ''CTR+B'': Open the [[Number Format Dialog]]&lt;br /&gt;
* ''CTR+U'': Open the [[Uncertainty Setup Dialog]]&lt;br /&gt;
* ''F8'': Change to Edit mode&lt;br /&gt;
* ''ctrl+click'': When the edit cursor is the a Definition in the Attribute panel at the bottom of a diagram, ''ctrl+click'' on another node to insert its identifier into the definition.&lt;br /&gt;
* Select several nodes in a Diagram and press:&lt;br /&gt;
** ''==''  resize the nodes to be the same as the last node you selected (the one with black boxes in the corners)&lt;br /&gt;
**''ctrl+='' align the nodes one above the other with same width&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Shortcuts for Toolbar buttons ==&lt;br /&gt;
&lt;br /&gt;
* F2: [[image:ParentTool.jpg]]: Open Diagram window containing the selected node.&lt;br /&gt;
* F3: [[image:OutlineTool.jpg]]: Open the Outliner window&lt;br /&gt;
* F4: [[image:ObjectWindowToolbarButton.jpg]]: Open the Object window for selected node.&lt;br /&gt;
* F5: [[image:ResultToolbarButton.jpg]]: Open the Result window for the selected variable. (same as CTRL+R)&lt;br /&gt;
* F6: [[image:Expr.jpg]]: Edit the definition (script for Button) of selected Variable or Function (same as CTRL+E) in Attribute Panel or Object window, depending on setting in Preferences... dialog.&lt;br /&gt;
* F7: [[image:browseTool.jpg]]: Enter browse mode &lt;br /&gt;
* F8: [[image:Edit_Mode_Toolbar_Button.jpg]]: Enter Edit mode&lt;br /&gt;
&lt;br /&gt;
== Shortcuts to add a nodes to a diagram ==&lt;br /&gt;
&lt;br /&gt;
* CTRL+1: New Decision node&lt;br /&gt;
* CTRL+2: New Variable node&lt;br /&gt;
* CTRL+3: New Chance node&lt;br /&gt;
* CTRL+4: New Objective node&lt;br /&gt;
* CTRL+5: New Module node &lt;br /&gt;
* CTRL+6: New Index node&lt;br /&gt;
* CTRL+7: New Constant node&lt;br /&gt;
* CTRL+8: New Function node&lt;br /&gt;
* CTRL+9: New Text node&lt;br /&gt;
* CTRL+0: New Button node&lt;br /&gt;
&lt;br /&gt;
== Tab as a shortcut ==&lt;br /&gt;
&lt;br /&gt;
Use the ''tab'' key to select the next element in a windowt: &lt;br /&gt;
* In a Diagram window, ''tab''  selects the next node from left to right, then up to down&lt;br /&gt;
* In an Object window,  ''tab'' selects the next Attribute field&lt;br /&gt;
* In a table,  ''tab'' selects the next cell.&lt;br /&gt;
&lt;br /&gt;
Use ''shift+tab'' to go backwards, to select the previous node, Attribute, or cell.&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts for menus ===&lt;br /&gt;
&lt;br /&gt;
* F10: Select the main menu bar. &lt;br /&gt;
** Use left or right arrow or a letter to select a menu. &lt;br /&gt;
** Use up or down arrow or a letter to select an option in that menu.  &lt;br /&gt;
&lt;br /&gt;
* F12, or CTRL+': Open/close typescript window&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts to edit a Definition or other attribute ===&lt;br /&gt;
&lt;br /&gt;
* Double-click an identifier to select it&lt;br /&gt;
* ''CTRL+f:'' Open [[find dialog]] for this identifier. A quick way to find the node for a variable, or open wiki page for a system function or variable.&lt;br /&gt;
* '''CTRL+click''' on a node:  When you are editing the Definition (or other attribute) in an Attribute panel, CTRL-click on another node in the same diagram inserts its identifier into the Definition. This shortcut is very handy when writing a complex expression.&lt;br /&gt;
* '''CTRL+alt''' on a node: Same as CTRL+click. Useful when running Analytica in VMWare Fusion on a Macintosh, which treats CTRL+click as something else. &lt;br /&gt;
* Return&lt;br /&gt;
* CTRL+Return&lt;br /&gt;
* CTRL+right-arrow: Move right one token (identifier or operator)&lt;br /&gt;
* CTRL+left-arrow: Move left one token (identifier or operator)&lt;br /&gt;
* CTRL+ALT+left-arrow: Find left paren that matches the right paren currently at the left of the caret.&lt;br /&gt;
* CTRL+ALT+right-arrow: Find right parent that matches the left parent currently to the right of the cursor.&lt;br /&gt;
* SHIFT+(any of the above): Select the characters between.&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts to edit a diagram ===&lt;br /&gt;
&lt;br /&gt;
* Arrow: Move selected node(s) in direction of the arrow by a grid increment, if snap to grid is set -- otherwise, by one pixel.&lt;br /&gt;
* SHIFT+arrow: Move selected node(s) in direction of the arrow, by one pixel if snap to grid is set -- otherwise, by one grid increment. &lt;br /&gt;
* CTRL+left-arrow: Align left edges&lt;br /&gt;
* CTRL+F9: Align horiz center&lt;br /&gt;
* SHIFT+F9: Align vert centers of selected nodes&lt;br /&gt;
* CTRL+right-arrow: Align right edges&lt;br /&gt;
* CTRL+=: Align left and right edges of selected nodes&lt;br /&gt;
* CTRL+up-arrow: Align tops of selected nodes&lt;br /&gt;
* CTRL+down-arrow: Align bottoms of selected nodes&lt;br /&gt;
&lt;br /&gt;
These shortcuts use two keystrokes in sequence -- not pressed together:&lt;br /&gt;
* =,right-arrow: Make selected nodes the same width as the first selected node &lt;br /&gt;
* =,down-arrow: Make selected nodes the same height as the first selected node&lt;br /&gt;
* =,=: Make selected nodes the same width and height as the first selected node&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts for Table Navigation ===&lt;br /&gt;
&lt;br /&gt;
Analytica supports almost all the standard shortcuts for tables offered by Microsoft Excel. See [[Shortcuts for Table Navigation]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Alphabetic list of CTRL shortcuts by letter ===&lt;br /&gt;
&lt;br /&gt;
* CTRL+A: Select All nodes in a diagram, text in a definition, or cells in a table.&lt;br /&gt;
* CTRL+B: Open [[Number Format Dialog]]&lt;br /&gt;
* CTRL+C: Copy selected node(s), text, cell or region of a table.&lt;br /&gt;
* CTRL+D: Duplicate selected node(s)&lt;br /&gt;
* CTRL+E: Edit definition of selected node in Attribute pane&lt;br /&gt;
* CTRL+F: Open [[Find Dialog]] to find an object by identifier or title. In a table, Find will search table.&lt;br /&gt;
* CTRL+G: Find next matching item from [[Find Dialog]].&lt;br /&gt;
* CTRL+H: Find object with identifier matching the text you have selected -- e.g. in a definition.&lt;br /&gt;
* CTRL+I: Insert a new row or column after the row or column you have selected in an Edit table.&lt;br /&gt;
* CTRL+J: In a Diagram, align selected node(s) to grid&lt;br /&gt;
* CTRL+K: Kill (delete) the row or column you have selected in an Edit table.&lt;br /&gt;
* CTRL+L: Open dialog to Add Module...&lt;br /&gt;
* CTRL+M: Make an alias from the selected node(s).&lt;br /&gt;
* CTRL+N: Start a New Model&lt;br /&gt;
* CTRL+O: Open a model file&lt;br /&gt;
* CTRL+P: Print the current Diagram, Graph&lt;br /&gt;
* CTRL+Q: Exit (Quit) the model.&lt;br /&gt;
* CTRL+R: Show result for selected variable(s)&lt;br /&gt;
* CTRL+S: Save the model&lt;br /&gt;
* CTRL+T: Adjust selected node(s) to their default size&lt;br /&gt;
* CTRL+U: Open Uncertainty Options... dialog&lt;br /&gt;
* CTRL+V: Paste text, cell or region of a table, or selected nodes.&lt;br /&gt;
* CTRL+W: Close the model&lt;br /&gt;
* CTRL+X: Cut selected text or node(s).&lt;br /&gt;
* CTRL+Y: Toggle between viewing titles and identifiers &lt;br /&gt;
* CTRL+Z: Undo last action (typing text or moving or resizing node(s)&lt;br /&gt;
* CTRL+. (CTRL+dot): Stop the computation in progress.&lt;br /&gt;
* CTRL+Break: Stop the computation in progress.&lt;br /&gt;
* CTRL+' (CTRL+apostrophe): Open/close Typescript window.  On some non-English keyboards, this combination is not available.  In those cases, use F12.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[Shortcuts for Table Navigation]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Keyboard_Shortcuts&amp;diff=61177</id>
		<title>Keyboard Shortcuts</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Keyboard_Shortcuts&amp;diff=61177"/>
		<updated>2024-07-16T00:20:03Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Ana: Status M]]  &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like most applications, Analytica offers keys or key combinations as shortcuts to access common features. Some, like ''ctrl+v'' to paste, or ''ctrl+s'' to '''s'''ave a model file, are common to most Windows applications.  Learning some of these can greatly speed up your interactions. &lt;br /&gt;
&lt;br /&gt;
You can see the keyboard shortcuts for Toolbar icon buttons in the tooltip that appears when you move the mouse cursor over each icon,  for menu options inside each menu at the top of the application, and for context-dependent menu that appears when you right-click. &lt;br /&gt;
&lt;br /&gt;
==Most valuable shortcuts==&lt;br /&gt;
&lt;br /&gt;
These are the most useful shortcuts to learn initially (beyond the standard shortcuts common to most Windows applications):&lt;br /&gt;
* ''CTRL+F'': Open the [[Find dialog]]&lt;br /&gt;
* ''CTRL+H'': Select a variable or function identifier in a definition, and press ''ctrl+H'' to open its Object view&lt;br /&gt;
* ''CTRL+R'': Select a node and see its result view&lt;br /&gt;
* ''CTR+B'': Open the [[Number Format Dialog]]&lt;br /&gt;
* ''CTR+U'': Open the [[Uncertainty Setup Dialog]]&lt;br /&gt;
* ''F8'': Change to Edit mode&lt;br /&gt;
* ''ctrl+click'': When the edit cursor is the a Definition in the Attribute panel at the bottom of a diagram, ''ctrl+click'' on another node to insert its identifier into the definition.&lt;br /&gt;
* Select several nodes in a Diagram and press:&lt;br /&gt;
** ''==''  resize the nodes to be the same as the last node you selected (the one with black boxes in the corners)&lt;br /&gt;
**''ctrl+='' align the nodes one above the other with same width&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Shortcuts for Toolbar buttons ==&lt;br /&gt;
&lt;br /&gt;
* F2: [[image:ParentTool.jpg]]: Open Diagram window containing the selected node.&lt;br /&gt;
* F3: [[image:OutlineTool.jpg]]: Open the Outliner window&lt;br /&gt;
* F4: [[image:ObjectWindowToolbarButton.jpg]]: Open the Object window for selected node.&lt;br /&gt;
* F5: [[image:ResultToolbarButton.jpg]]: Open the Result window for the selected variable. (same as CTRL+R)&lt;br /&gt;
* F6: [[image:Expr.jpg]]: Edit the definition (script for Button) of selected Variable or Function (same as CTRL+E) in Attribute Panel or Object window, depending on setting in Preferences... dialog.&lt;br /&gt;
* F7: [[image:browseTool.jpg]]: Enter browse mode &lt;br /&gt;
* F8: [[image:Edit_Mode_Toolbar_Button.jpg]]: Enter Edit mode&lt;br /&gt;
* F9: [[image:arrowTool.jpg]]: Enter Arrow mode.&lt;br /&gt;
* F11: Toggle between Edit/Arrow editing modes  ([[image:Edit_Mode_Toolbar_Button.jpg]] &amp;amp;larr;&amp;amp;rarr; [[image:arrowTool.jpg]] ). &lt;br /&gt;
&lt;br /&gt;
== Shortcuts to add a nodes to a diagram ==&lt;br /&gt;
&lt;br /&gt;
* CTRL+1: New Decision node&lt;br /&gt;
* CTRL+2: New Variable node&lt;br /&gt;
* CTRL+3: New Chance node&lt;br /&gt;
* CTRL+4: New Objective node&lt;br /&gt;
* CTRL+5: New Module node &lt;br /&gt;
* CTRL+6: New Index node&lt;br /&gt;
* CTRL+7: New Constant node&lt;br /&gt;
* CTRL+8: New Function node&lt;br /&gt;
* CTRL+9: New Text node&lt;br /&gt;
* CTRL+0: New Button node&lt;br /&gt;
&lt;br /&gt;
== Tab as a shortcut ==&lt;br /&gt;
&lt;br /&gt;
Use the ''tab'' key to select the next element in a windowt: &lt;br /&gt;
* In a Diagram window, ''tab''  selects the next node from left to right, then up to down&lt;br /&gt;
* In an Object window,  ''tab'' selects the next Attribute field&lt;br /&gt;
* In a table,  ''tab'' selects the next cell.&lt;br /&gt;
&lt;br /&gt;
Use ''shift+tab'' to go backwards, to select the previous node, Attribute, or cell.&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts for menus ===&lt;br /&gt;
&lt;br /&gt;
* F10: Select the main menu bar. &lt;br /&gt;
** Use left or right arrow or a letter to select a menu. &lt;br /&gt;
** Use up or down arrow or a letter to select an option in that menu.  &lt;br /&gt;
&lt;br /&gt;
* F12, or CTRL+': Open/close typescript window&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts to edit a Definition or other attribute ===&lt;br /&gt;
&lt;br /&gt;
* Double-click an identifier to select it&lt;br /&gt;
* ''CTRL+f:'' Open [[find dialog]] for this identifier. A quick way to find the node for a variable, or open wiki page for a system function or variable.&lt;br /&gt;
* '''CTRL+click''' on a node:  When you are editing the Definition (or other attribute) in an Attribute panel, CTRL-click on another node in the same diagram inserts its identifier into the Definition. This shortcut is very handy when writing a complex expression.&lt;br /&gt;
* '''CTRL+alt''' on a node: Same as CTRL+click. Useful when running Analytica in VMWare Fusion on a Macintosh, which treats CTRL+click as something else. &lt;br /&gt;
* Return&lt;br /&gt;
* CTRL+Return&lt;br /&gt;
* CTRL+right-arrow: Move right one token (identifier or operator)&lt;br /&gt;
* CTRL+left-arrow: Move left one token (identifier or operator)&lt;br /&gt;
* CTRL+ALT+left-arrow: Find left paren that matches the right paren currently at the left of the caret.&lt;br /&gt;
* CTRL+ALT+right-arrow: Find right parent that matches the left parent currently to the right of the cursor.&lt;br /&gt;
* SHIFT+(any of the above): Select the characters between.&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts to edit a diagram ===&lt;br /&gt;
&lt;br /&gt;
* Arrow: Move selected node(s) in direction of the arrow by a grid increment, if snap to grid is set -- otherwise, by one pixel.&lt;br /&gt;
* SHIFT+arrow: Move selected node(s) in direction of the arrow, by one pixel if snap to grid is set -- otherwise, by one grid increment. &lt;br /&gt;
* CTRL+left-arrow: Align left edges&lt;br /&gt;
* CTRL+F9: Align horiz center&lt;br /&gt;
* SHIFT+F9: Align vert centers of selected nodes&lt;br /&gt;
* CTRL+right-arrow: Align right edges&lt;br /&gt;
* CTRL+=: Align left and right edges of selected nodes&lt;br /&gt;
* CTRL+up-arrow: Align tops of selected nodes&lt;br /&gt;
* CTRL+down-arrow: Align bottoms of selected nodes&lt;br /&gt;
&lt;br /&gt;
These shortcuts use two keystrokes in sequence -- not pressed together:&lt;br /&gt;
* =,right-arrow: Make selected nodes the same width as the first selected node &lt;br /&gt;
* =,down-arrow: Make selected nodes the same height as the first selected node&lt;br /&gt;
* =,=: Make selected nodes the same width and height as the first selected node&lt;br /&gt;
&lt;br /&gt;
=== Shortcuts for Table Navigation ===&lt;br /&gt;
&lt;br /&gt;
Analytica supports almost all the standard shortcuts for tables offered by Microsoft Excel. See [[Shortcuts for Table Navigation]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Alphabetic list of CTRL shortcuts by letter ===&lt;br /&gt;
&lt;br /&gt;
* CTRL+A: Select All nodes in a diagram, text in a definition, or cells in a table.&lt;br /&gt;
* CTRL+B: Open [[Number Format Dialog]]&lt;br /&gt;
* CTRL+C: Copy selected node(s), text, cell or region of a table.&lt;br /&gt;
* CTRL+D: Duplicate selected node(s)&lt;br /&gt;
* CTRL+E: Edit definition of selected node in Attribute pane&lt;br /&gt;
* CTRL+F: Open [[Find Dialog]] to find an object by identifier or title. In a table, Find will search table.&lt;br /&gt;
* CTRL+G: Find next matching item from [[Find Dialog]].&lt;br /&gt;
* CTRL+H: Find object with identifier matching the text you have selected -- e.g. in a definition.&lt;br /&gt;
* CTRL+I: Insert a new row or column after the row or column you have selected in an Edit table.&lt;br /&gt;
* CTRL+J: In a Diagram, align selected node(s) to grid&lt;br /&gt;
* CTRL+K: Kill (delete) the row or column you have selected in an Edit table.&lt;br /&gt;
* CTRL+L: Open dialog to Add Module...&lt;br /&gt;
* CTRL+M: Make an alias from the selected node(s).&lt;br /&gt;
* CTRL+N: Start a New Model&lt;br /&gt;
* CTRL+O: Open a model file&lt;br /&gt;
* CTRL+P: Print the current Diagram, Graph&lt;br /&gt;
* CTRL+Q: Exit (Quit) the model.&lt;br /&gt;
* CTRL+R: Show result for selected variable(s)&lt;br /&gt;
* CTRL+S: Save the model&lt;br /&gt;
* CTRL+T: Adjust selected node(s) to their default size&lt;br /&gt;
* CTRL+U: Open Uncertainty Options... dialog&lt;br /&gt;
* CTRL+V: Paste text, cell or region of a table, or selected nodes.&lt;br /&gt;
* CTRL+W: Close the model&lt;br /&gt;
* CTRL+X: Cut selected text or node(s).&lt;br /&gt;
* CTRL+Y: Toggle between viewing titles and identifiers &lt;br /&gt;
* CTRL+Z: Undo last action (typing text or moving or resizing node(s)&lt;br /&gt;
* CTRL+. (CTRL+dot): Stop the computation in progress.&lt;br /&gt;
* CTRL+Break: Stop the computation in progress.&lt;br /&gt;
* CTRL+' (CTRL+apostrophe): Open/close Typescript window.  On some non-English keyboards, this combination is not available.  In those cases, use F12.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[Shortcuts for Table Navigation]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Choice&amp;diff=61174</id>
		<title>Choice</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Choice&amp;diff=61174"/>
		<updated>2024-07-15T17:17:05Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Separator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Functions that select part of an array]]&lt;br /&gt;
[[Category:Top level functions]]&lt;br /&gt;
[[Category: Menus]]&lt;br /&gt;
[[Category:User-interface functions]]&lt;br /&gt;
{{ReleaseBar}}&lt;br /&gt;
&lt;br /&gt;
== Choice(i, n) ==&lt;br /&gt;
[[Choice]] displays a drop-down menu to allow an end user to select from a list of options. The index «i» is the list of options -- an index containing the values appearing on the popup.  When &amp;lt;code&amp;gt;I: Self&amp;lt;/code&amp;gt;, the values listed in the variable's domain are used.  «N» is the position of the currently selected option in that list, or 0 for ''All''.  This should always be an explicit integer, not an expression.&lt;br /&gt;
&lt;br /&gt;
When the user selects a different option, it changes the value of «n». You can use Choice to provide a menu as the definition of a variable or in a cell of an Edit table (or [[ProbTable]] or [[DetermTable]]). [[Choice]] must be the top level of the definition or the cell, and may not be nested within an expression. You must create an Input node for the variable before it will display choices as menus. &lt;br /&gt;
&lt;br /&gt;
When a user changes the selection using the dropdown, the second parameter in the definition is replaced with the new choice.&lt;br /&gt;
&lt;br /&gt;
Use [[Choice]] when you was the user to select only a single option at a time, or (optionally) every option. If you would like the user to be able to select any subset of options, use [[MultiChoice]]. A [[Slider]] is also another possible UI control for selecting a single value at a time.&lt;br /&gt;
&lt;br /&gt;
The full declaration of Choice() is:&lt;br /&gt;
:[[Choice]](I: Index; n: atomic nonNegative; inclAll: optional boolean = True; Eval: optional boolean = True; Result: optional Array[I], separator: optional text)&lt;br /&gt;
&lt;br /&gt;
==Optional parameters==&lt;br /&gt;
===InclAll===&lt;br /&gt;
«inclAll»  (default &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;) specifies whether the &amp;quot;All&amp;quot; option is displayed. &lt;br /&gt;
&lt;br /&gt;
By default, the menu will include ''All'' as the first option. If you choose ''All'', the result will be computed for each value of index «i». This makes it easy to do a parametric analysis to see how the choices affect the results.  When you choose ''All'', it sets parameter «n» to 0.&lt;br /&gt;
&lt;br /&gt;
If you select ''All'' for multiple Choice menus, results will be computed for all combinations of values from those menus. Each selection of All may add an index dimension to the results. So if there are more than two or three, the number of dimensions may make the result hard to understand, and long to compute. In a few cases, the model may not be able to compute correctly with ''All''. In such cases, you can turn off ''All'' as an option by setting an optional third parameter, «inclAll» to &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt; (0). It usually advisable to set «inclAll» to &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt; whenever you use [[Choice]] in an Edit table.&lt;br /&gt;
&lt;br /&gt;
===Eval===&lt;br /&gt;
The «Eval» parameter specifies whether [[handle]] or expression terms are evaluated for the return value. &lt;br /&gt;
&lt;br /&gt;
The «Eval» parameter has no effect when the Result parameter is specified, or when «I» contains only constants, such as numbers and text strings.  Setting «Eval» to false is recommended in most cases when «I» contains [[handle]]s (variable identifiers). The «Eval» parameter has no effect when «I» is Self (it is always treated as false).&lt;br /&gt;
&lt;br /&gt;
===Result===&lt;br /&gt;
The [[Choice]] function has an optional parameter, «Result», that can be used to specify the value returned when Choice is evaluated in a completely general manner: «Result» specifies a return value for each choice different from the value in «I». Using the «Result» parameter, the result of evaluating Choice can be totally separate from the value appearing on the pull-down itself.&lt;br /&gt;
&lt;br /&gt;
Choice normally returns the selected index label.  The following syntax returns the index position (rather than label) of the selected value:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(I, 1, Result: @I)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Suppose you have a table &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and you want your user to select a row of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and then select out only the selected row.  A standard formulation of this is:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Table(I)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision selectedRow := Choice(I, 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable selectedA := A[I = selectedRow]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the «Result» parameter, a variable can be eliminated:&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Table(I)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision selectedA := Choice(I, 1, Result: A)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the «Result» parameter is specified, the «Eval» parameter does nothing.&lt;br /&gt;
&lt;br /&gt;
=== Separator===&lt;br /&gt;
You can specify that certain items in &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; are to display as separators.  Separators are horizontal lines on the popup that are nonselectable.  To include separators, use the «separator» parameter to specify what value in «I» should display as a separator.  You can include that value in &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; multiple times for multiple separators:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(I, 1, separator:'---')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Country_S := ['Canada', 'Mexico', 'USA', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'England', 'France', 'Germany', 'Russia', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'China', 'India', 'Japan','Philippines', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'Australia', 'New Zealand', '---',&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;'Argentina', 'Brazil', 'Chile']&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Select_country := Choice(Country_S, 1, separator:'---')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:[[image:choice_with_separators.png]]&lt;br /&gt;
&lt;br /&gt;
=== labels and selectionLabels ===&lt;br /&gt;
'''New to [[Analytica 6.4]]''&lt;br /&gt;
&lt;br /&gt;
These optional parameters enable you to display values in the popup menu or in the control that are different from the index values in «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;». Without these, the index values appear.  When used, these should be indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. In the case of a Self-choice, you may need to supply a list of values, which has the disadvantage that it cannot adapt to changes in length or re-orderings of the domain value.   You can also supply images for either -- if you do so, keep them small. They are not resized from the original size.&lt;br /&gt;
&lt;br /&gt;
«labels» contains the values that appear on the popup menu.  When «selectionLabels» isn't also specified, these are also used for the selected value in the control itself.&lt;br /&gt;
&lt;br /&gt;
«selectionLabels» contains the values that appear as the selected value in the control itself.&lt;br /&gt;
&lt;br /&gt;
'''Example 1: City selection'''  &lt;br /&gt;
&lt;br /&gt;
This example of selecting a city from a hierarchical menu provides an example where it is convenient to have different values for the index value (the result), the «labels» and the «selectionLabels». A given city name often appears in multiple states, for example Salem, Oregon and Salem, New York. To keep index elements unique, the values in the index have the full name in the form &amp;lt;code&amp;gt;&amp;quot;Oregon, Salem&amp;quot;&amp;lt;/code&amp;gt;, etc.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index City := [&amp;quot;Alabama, Auburn&amp;quot;, &amp;quot;Alabama, Florence&amp;quot;, &amp;quot;Alabama, Marion&amp;quot;, ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable State_name := [[FindInText]](&amp;quot;^(.+),&amp;quot;,City,subpattern:1,return:'S')&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable City_name := [[FindInText]](&amp;quot;,\s*(.+)\s*$&amp;quot;,City,subpattern:1,return:'S')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State_name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;City_name&amp;lt;/code&amp;gt; are indexed by &amp;lt;code&amp;gt;City&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Our city selection can now present only the city name on the menus, but the full name in the selection (and result):&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Choose_city := [[Choice]]( City, 8, inclAll:False, labels:City_name, selectionLabels:City, nestUnder: State_name )&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;amp;rarr;&lt;br /&gt;
:[[image:city select hierarchy.png]]&lt;br /&gt;
&lt;br /&gt;
'''Example 2: Color picker'''&lt;br /&gt;
A second example where it is useful for the labels to be different from the index values is a color picker. The &amp;lt;code&amp;gt;Color&amp;lt;/code&amp;gt; index can contain the color names or RGB integers, whereas the choice contains color swatches (images).&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Index Color := ['red','white','blue','orange','green']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Color_swatch := [[CanvasImage]]( [[Canvas]]( 10, 25, Color ]] )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Choose_color := [[Choice]]( Color, 1, labels:Color_swatch)&amp;lt;/code&amp;gt; &amp;amp;rarr;&lt;br /&gt;
::[[image:Color_picker_choice.png]]&lt;br /&gt;
&lt;br /&gt;
The result of &amp;lt;code&amp;gt;Choose_color&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;&amp;quot;Green&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== nestUnder for hierarchical menus ===&lt;br /&gt;
''New to [[Analytica 6.4]]''&lt;br /&gt;
&lt;br /&gt;
This optional parameter lets you organize the options into hierarchical submenus. The parameter should be a 1-D array indexed by «&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;». The entries must all be text or Null.  Text entries contain the name of the submenu. Multiple levels of submenus are separated by '&amp;gt;'.  For example, consider a &amp;lt;code&amp;gt;City&amp;lt;/code&amp;gt; index with this «nestUnder» array:&lt;br /&gt;
&lt;br /&gt;
::Variable City_submenus &amp;amp;rarr; [[image:City_submenus.png]]&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;code&amp;gt;[[Choice]]( City, 1, nestUnder: City_submenus )&amp;lt;/code&amp;gt; produces this multilevel pulldown:&lt;br /&gt;
&lt;br /&gt;
::[[Image:nestUnderEx.png]]&lt;br /&gt;
&lt;br /&gt;
In this example, Arizona and Nevada are only one level deep, each with a single element, while San Jose is two levels deep, with counties, and cities within each county.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Suppose multiple variables use [[Choice]](I, n) with the same index &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, and you choose ''All'' for each of them, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['Low', 'Mid', 'High']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Result := IF A = 'Low' AND B = 'Low' THEN 0 ELSE 100 &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Array(I, [0, 100, 100])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Result&amp;lt;/code&amp;gt; is indexed by I only once, and A and B are treated as if they have the same values. If you wanted to vary them independently, they should use different indexes, e.g.&lt;br /&gt;
:&amp;lt;code&amp;gt;Index I := ['Low', 'Mid', 'High']&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := Choice(I, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Index J := CopyIndex(I)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable B := Choice(J, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable Result := IF A = 'Low' AND B = 'Low' THEN 0 ELSE 100 &amp;amp;rarr;&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;Array(I, J, [0, 100, 100], [100, 100, 100], [100, 100, 100])&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function [[CopyIndex]](I) makes returns a new index with the same values as &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==Details and more examples==&lt;br /&gt;
=== Self-Indexed Choices ===&lt;br /&gt;
When a variable is defined with the first parameter set to [[Self]], as in the definition:&lt;br /&gt;
:&amp;lt;code&amp;gt;Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then the set of values appearing in the choice are located in the variable's own domain attribute.  In this case, the domain must be either a list, list-of-labels or index type.&lt;br /&gt;
&lt;br /&gt;
The easiest way to create a Self-Choice is to select &amp;quot;Choice...&amp;quot; from the definition type popup.  Analytica will then fill in a default one-element list-of-labels selection. &lt;br /&gt;
&lt;br /&gt;
When a domain is a list, the elements are usually numbers, but may also be variable identifiers or expressions.  (See &amp;quot;Identifier and Expression items&amp;quot; below).&lt;br /&gt;
&lt;br /&gt;
If you use an Index domain, then the values for domain of [[Self]] come from another index variable.  In this case, &amp;lt;code&amp;gt;Choice(Self,1)&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;domain = I&amp;lt;/code&amp;gt; is very similar to &amp;lt;code&amp;gt;Choice(I,1)&amp;lt;/code&amp;gt; with no domain set.  There are, however, several differences. &lt;br /&gt;
&lt;br /&gt;
First, if you use an index domain, then your variable will have both an index value and mid/prob values, while if you use &amp;lt;code&amp;gt;Choice(I, 1)&amp;lt;/code&amp;gt; your variable will not have an index semantics.  &lt;br /&gt;
&lt;br /&gt;
Second, if &amp;quot;All&amp;quot; is selected in the pulldown, the result of &amp;lt;ode&amp;gt;Choice(I, 0)&amp;lt;/code&amp;gt; is indexed by &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;Choice(Self, 0)&amp;lt;/code&amp;gt; is indexed by [[Self]].  &lt;br /&gt;
&lt;br /&gt;
Third, in an index domain using Index I, the values in the domain are the evaluated values of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;.  If &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; contains only numbers and text strings, then these are the same as the values of &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt;, but if &amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; contains identifiers or expressions, then there is a difference.  &amp;lt;code&amp;gt;Choice(I, 1)&amp;lt;/code&amp;gt; would show the identifiers or expressions, while &amp;lt;code&amp;gt;Choice(Self, 1)&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;domain = I&amp;lt;/code&amp;gt; would show the values of those variables in the pulldown.&lt;br /&gt;
&lt;br /&gt;
=== Input Nodes ===&lt;br /&gt;
Selecting &amp;quot;Make Input&amp;quot; from the Object menu creates a pull-down control that you can position on your diagram as part of a user-interface form.&lt;br /&gt;
&lt;br /&gt;
=== Pull-downs in edit tables ===&lt;br /&gt;
You can put a  [[Choice]]  pulldown menu in a cell of an edit table. Just type the expression, such as &amp;lt;code&amp;gt;Choice(option, 1, 0)&amp;lt;/code&amp;gt;. where &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; is an index containing the possible options. You usually set the third parameter, «inclAll», to 0, so to remove the ''All'' option. Otherwise, if the user selects &amp;quot;All&amp;quot; in a table, array abstraction causes the index  &amp;lt;code&amp;gt;option&amp;lt;/code&amp;gt; to become an index of the entire value of the table result.  Similarly, you can specify [[Choice]] and [[Checkbox]] in the cells of any [[DetermTable]], [[ProbTable]], [[IntraTable]], or  [[SubTable]]. &lt;br /&gt;
&lt;br /&gt;
When you enter a valid [[Choice]] or [[Checkbox]] expression into a table cell, the cell immediately shows the menu or checkbox.  But, you will also see an expression/choice selector near the right top of the window:&lt;br /&gt;
&lt;br /&gt;
:[[image:expr-choice-selector.png]]&lt;br /&gt;
&lt;br /&gt;
If you select the ''expr'' option, you will see all cells as text expressions, so you can review and edit them directly.  &lt;br /&gt;
&lt;br /&gt;
In browse mode, these cells with controls always appear as controls.  The controls appear as disabled (so you can't change them) in browse mode, unless or until you create an input node for the table.&lt;br /&gt;
&lt;br /&gt;
==== In Analytica 4.0 thru Analytica 4.4 ====&lt;br /&gt;
&lt;br /&gt;
In these earlier versions, there is now expression/choice select, and you can only see the   expression in Edit mode, allowing you to edit the definition.&lt;br /&gt;
&lt;br /&gt;
=== Using Choice with DetermTable ===&lt;br /&gt;
A useful arrangement is to use [[Choice]] variables for key parameters, especially parameters where you may want to perform a parametric analysis (by selecting &amp;quot;All&amp;quot;), and then organizing tabular data in [[DetermTable]]s (rather than standard Edit Tables).  This arrangement looks like the following:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision Scenario := Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Domain of Scenario : [1, 2, 3, 4]&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := DetermTable(Scenario)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this arrangement, the definition of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; appears as an edit table, indexed by all domain values of &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt;.  However, when evaluated, only the selected row is returned.&lt;br /&gt;
&lt;br /&gt;
With this arrangement, you can compute downstream results for a single &amp;lt;code&amp;gt;Scenario&amp;lt;/code&amp;gt; (or other dimension), or for every scenario when &amp;quot;All&amp;quot; is selected.  When available memory limits your ability to perform a full parameter analysis across many dimensions (since the number of combinations increases multiplicatively), this setup makes it easy to limit the parametric analysis to only selected dimensions.&lt;br /&gt;
&lt;br /&gt;
A second variation on this is:&lt;br /&gt;
:&amp;lt;code&amp;gt;Index AllScenarios := [1, 2, 3, 4]&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Decision Scenario := Choice(Self, 0)&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Domain of Scenario : Index AllScenarios&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;Variable A := DetermTable(Scenario)(...)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Identifier and Expression Items ===&lt;br /&gt;
When an option in «I» is a [[handle]] to a variable, then the pulldown will display either the title of the object or its identifier, depending on whether &amp;quot;Show By Identifier&amp;quot; is selected.  The &amp;quot;Show By Identifier&amp;quot; setting is found on the '''Object''' menu and can also be toggled by pressing ''Ctrl+Y'' .&lt;br /&gt;
&lt;br /&gt;
When you want to set up an explicit list of identifiers to select between, the best way to do this is to create an index node and turn on its [[MetaOnly]] attribute. Then set the definition to be a list and enter the identifiers in each cell. You can also compute a list of identifiers.&lt;br /&gt;
&lt;br /&gt;
When the selected item is a [[handle]] to a variable, the result of evaluating the [[Choice]] function will be either the handle or the result of evaluating the handle, as follows. If the «eval» parameter is specified and set to false, or if the «I» option is [[Self]], then the result is the handle. If the «eval» parameter is specified and true, and the «I» parameter is an index (i.e., not [[Self]]), then the result is the result of evaluating the selected variable. When «eval» is not specified, then a handle is returned if «I» is index node with the [[MetaOnly]] attribute set or if «I» species the domain of another variable, or otherwise the result of evaluating the variable is returned.&lt;br /&gt;
&lt;br /&gt;
If you are dealing with Choices involving variable identifiers, using &amp;lt;code&amp;gt;Eval: False&amp;lt;/code&amp;gt; is generally preferred.  Operations such as comparing the selected value to the original index, or use of a [[DetermTable]] based on the choice variable, function more consistently and less ambiguously.  As a comparison, if you return values (e.g., &amp;lt;code&amp;gt;Eval: True&amp;lt;/code&amp;gt;), and two variables in the choice happen to have the same value, then an ambiguity over which variable was selected exists, but with &amp;lt;code&amp;gt;Eval: False&amp;lt;/code&amp;gt; no such ambiguity exists.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
Releases prior to Analytica 4.4.2 do not support extremely long option lists on the [[Choice]] popup.  In those releases, the choice pulldown displays only the first 254 items, plus the selected item.  This limitation is fixed in patch release 4.4.2, where no such limitation exists.  If you have many options and for some reason cannot upgrade to 4.4.2 or later, consider creating a 2-stage hierarchical menu, where the first pulldown offers subgroups, and the second shows a the items in that subgroup.&lt;br /&gt;
&lt;br /&gt;
Pulldowns in [[Analytica 4.5]] and later are described [[#In Analytica 4.5 or later|above]].&lt;br /&gt;
&lt;br /&gt;
[[Analytica 6.4]] added an option to add a hierarchical organization to the items by specifying an optional «nestUnder» parameter.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Choice menu user input]]&lt;br /&gt;
* [[Choice menus and Checkboxes in an edit table]]&lt;br /&gt;
* [[MultiChoice]]&lt;br /&gt;
* [[Checkbox]]&lt;br /&gt;
* [[Slider]]&lt;br /&gt;
* [[AskMsgChoice]]&lt;br /&gt;
* [[MetaOnly]]&lt;br /&gt;
* Webinar on [[Analytica_User_Group/Past_Topics#Creating_Control_Panels|Creating Control Panels]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Assista_-_Analytica_AI_Assistant&amp;diff=61160</id>
		<title>Assista - Analytica AI Assistant</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Assista_-_Analytica_AI_Assistant&amp;diff=61160"/>
		<updated>2024-07-12T16:31:02Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Privacy (or lack of) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New in [[Analytica 6.5]]''&lt;br /&gt;
&lt;br /&gt;
The Analytica A.I. assistant, named ''Assista'', is a co-pilot that uses Artificial Intelligence to help you use Analytica and build models. &lt;br /&gt;
&lt;br /&gt;
'''Note: In the early 6.5 alpha builds, it requires Analytica Enterprise or Optimizer to use.'''&lt;br /&gt;
&lt;br /&gt;
Ask Assista for help or support using plain English, or even in other non-English languages. It knows what you are/were currently looking at just prior to switching over to the chat window, and it can access much of your model to provide you answers. It can also carry out many tasks for you in the Analytica UI. &lt;br /&gt;
&lt;br /&gt;
== Inaccuracies ==&lt;br /&gt;
It is important to understand that, like other AI systems, it is not always accurate. It makes mistakes and sometimes provides incorrect information. But if it leads you astray today, don't give up on it!  We are improving it, and your questions will help it to improve in the future.  With time, it will be more and more capable of helping you with all stages of model building and interpreting results.&lt;br /&gt;
&lt;br /&gt;
== Privacy (or lack of) ==&lt;br /&gt;
&lt;br /&gt;
When you use Assista, your questions and some model information are sent to Lumina's servers as well as to OpenAI's servers. We use this information in a variety of ways to improve Assista in the future. We at Lumina take privacy seriouslyl, and will make our best effort to protect this information from uses other than to operate and improve Assista. &lt;br /&gt;
&lt;br /&gt;
If you do not use the A.I. assistant at all, no information is sent, so you need not worry about this when simply using Analytica.&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
What types of things can Assista help you with? This section identifies some areas, but these do not fully cover its full scope.&lt;br /&gt;
&lt;br /&gt;
Please ask it for whatever help you need, even if it doesn't match stuff shown here! It may surprise you, but even if it fails, your questions may inform Assista's engineers about what types of capabilities would be useful to focus on.&lt;br /&gt;
&lt;br /&gt;
Assista relies heavily on the documentation attributes (Title, Description, Units) in your model, and on the arrows that you have drawn between variables (even if they aren't yet defined). Keep those populated both for your own benefit, but also to increase the quality of the assistance. You can even ask it to write those descriptions for you.&lt;br /&gt;
&lt;br /&gt;
=== Using Analytica's UI ===&lt;br /&gt;
&lt;br /&gt;
::''How do you ... in Analytica?''&lt;br /&gt;
&lt;br /&gt;
Ask it for the steps required to do something using the Analytica's UI. &lt;br /&gt;
&lt;br /&gt;
Inaccuracies in its steps sometimes occur. But improving this accuracy is our first area of focus.&lt;br /&gt;
&lt;br /&gt;
=== Navigating the Docs ===&lt;br /&gt;
&lt;br /&gt;
As you likely know, the Analytica Docs are extensive. Assista often provides &amp;quot;see also&amp;quot; links it is response to relevant Docs pages.&lt;br /&gt;
&lt;br /&gt;
Ask it for a list of functions of a specified type, for example, Or where you can find more information on something.&lt;br /&gt;
&lt;br /&gt;
This general area is our second focus priority. &lt;br /&gt;
&lt;br /&gt;
=== Performing actions for you ===&lt;br /&gt;
&lt;br /&gt;
In addition to providing steps you need to take to accomplish something from the Analytica GUI, Assista can sometimes do it for you! &lt;br /&gt;
* Open the graph of X     { or edit table, result table, object window, etc.)&lt;br /&gt;
* Change the color of X to blue&lt;br /&gt;
* Write this description&lt;br /&gt;
* Write this definition.&lt;br /&gt;
* ... and more&lt;br /&gt;
&lt;br /&gt;
=== Explaining Analytica concepts ===&lt;br /&gt;
&lt;br /&gt;
Ask it to teach you more about Analytica concepts.&lt;br /&gt;
&lt;br /&gt;
=== Creative formulation ===&lt;br /&gt;
&lt;br /&gt;
Mapping your complex, messy, real world problem to an influence diagram that captures the essential elements is a challenging task for human model builders. This is also one of the most exciting use cases for this new technology, especially in a collaborative analyst-assistant partnership. &lt;br /&gt;
&lt;br /&gt;
Extreme competence at this is a long term future goal for Assista, but there is reason to believe that it could become quite good eventually. &lt;br /&gt;
&lt;br /&gt;
=== Interpreting results ===&lt;br /&gt;
&lt;br /&gt;
How do you interpret results, and how should you act based on the insights you gain from the model? &lt;br /&gt;
&lt;br /&gt;
Today, Assista is unlikely to help much at this. For one, it doesn't yet look directly at the raw numbers or graph images in your results (or in your edit tables), even thought it is aware of your graphing dimensions (axes, keys) and table pivots.&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
This list of ideas is by no means complete. If you could use some help while using Analytica, ask it even if it doesn't fall into any of these categories. There is a chance it might, and you might inspire us to extend its capabilities in new directions.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* See some use case examples in [https://downloads.analytica.com/Videos/AI_Series/AAIA_alpha_demo.mp4| a short unpolished demo].&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Assista_-_Analytica_AI_Assistant&amp;diff=61159</id>
		<title>Assista - Analytica AI Assistant</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Assista_-_Analytica_AI_Assistant&amp;diff=61159"/>
		<updated>2024-07-12T16:27:58Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Inaccuracies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''New in [[Analytica 6.5]]''&lt;br /&gt;
&lt;br /&gt;
The Analytica A.I. assistant, named ''Assista'', is a co-pilot that uses Artificial Intelligence to help you use Analytica and build models. &lt;br /&gt;
&lt;br /&gt;
'''Note: In the early 6.5 alpha builds, it requires Analytica Enterprise or Optimizer to use.'''&lt;br /&gt;
&lt;br /&gt;
Ask Assista for help or support using plain English, or even in other non-English languages. It knows what you are/were currently looking at just prior to switching over to the chat window, and it can access much of your model to provide you answers. It can also carry out many tasks for you in the Analytica UI. &lt;br /&gt;
&lt;br /&gt;
== Inaccuracies ==&lt;br /&gt;
It is important to understand that, like other AI systems, it is not always accurate. It makes mistakes and sometimes provides incorrect information. But if it leads you astray today, don't give up on it!  We are improving it, and your questions will help it to improve in the future.  With time, it will be more and more capable of helping you with all stages of model building and interpreting results.&lt;br /&gt;
&lt;br /&gt;
== Privacy (or lack of) ==&lt;br /&gt;
It is important to keep in mind that when you use Assista, your questions AND information inside your model will be sent to Lumina's servers as well as to OpenAI's servers, and may be used in a variety of ways to improve Assista in the future. We at Lumina are very privacy conscious in general, and will make our best effort to protect the information from uses other than for Assista improvement. &lt;br /&gt;
&lt;br /&gt;
If you do not use the A.I. assistant at all, no information is sent, so you need not worry about this when simply using Analytica.&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
What types of things can Assista help you with? This section identifies some areas, but these do not fully cover its full scope.&lt;br /&gt;
&lt;br /&gt;
Please ask it for whatever help you need, even if it doesn't match stuff shown here! It may surprise you, but even if it fails, your questions may inform Assista's engineers about what types of capabilities would be useful to focus on.&lt;br /&gt;
&lt;br /&gt;
Assista relies heavily on the documentation attributes (Title, Description, Units) in your model, and on the arrows that you have drawn between variables (even if they aren't yet defined). Keep those populated both for your own benefit, but also to increase the quality of the assistance. You can even ask it to write those descriptions for you.&lt;br /&gt;
&lt;br /&gt;
=== Using Analytica's UI ===&lt;br /&gt;
&lt;br /&gt;
::''How do you ... in Analytica?''&lt;br /&gt;
&lt;br /&gt;
Ask it for the steps required to do something using the Analytica's UI. &lt;br /&gt;
&lt;br /&gt;
Inaccuracies in its steps sometimes occur. But improving this accuracy is our first area of focus.&lt;br /&gt;
&lt;br /&gt;
=== Navigating the Docs ===&lt;br /&gt;
&lt;br /&gt;
As you likely know, the Analytica Docs are extensive. Assista often provides &amp;quot;see also&amp;quot; links it is response to relevant Docs pages.&lt;br /&gt;
&lt;br /&gt;
Ask it for a list of functions of a specified type, for example, Or where you can find more information on something.&lt;br /&gt;
&lt;br /&gt;
This general area is our second focus priority. &lt;br /&gt;
&lt;br /&gt;
=== Performing actions for you ===&lt;br /&gt;
&lt;br /&gt;
In addition to providing steps you need to take to accomplish something from the Analytica GUI, Assista can sometimes do it for you! &lt;br /&gt;
* Open the graph of X     { or edit table, result table, object window, etc.)&lt;br /&gt;
* Change the color of X to blue&lt;br /&gt;
* Write this description&lt;br /&gt;
* Write this definition.&lt;br /&gt;
* ... and more&lt;br /&gt;
&lt;br /&gt;
=== Explaining Analytica concepts ===&lt;br /&gt;
&lt;br /&gt;
Ask it to teach you more about Analytica concepts.&lt;br /&gt;
&lt;br /&gt;
=== Creative formulation ===&lt;br /&gt;
&lt;br /&gt;
Mapping your complex, messy, real world problem to an influence diagram that captures the essential elements is a challenging task for human model builders. This is also one of the most exciting use cases for this new technology, especially in a collaborative analyst-assistant partnership. &lt;br /&gt;
&lt;br /&gt;
Extreme competence at this is a long term future goal for Assista, but there is reason to believe that it could become quite good eventually. &lt;br /&gt;
&lt;br /&gt;
=== Interpreting results ===&lt;br /&gt;
&lt;br /&gt;
How do you interpret results, and how should you act based on the insights you gain from the model? &lt;br /&gt;
&lt;br /&gt;
Today, Assista is unlikely to help much at this. For one, it doesn't yet look directly at the raw numbers or graph images in your results (or in your edit tables), even thought it is aware of your graphing dimensions (axes, keys) and table pivots.&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
This list of ideas is by no means complete. If you could use some help while using Analytica, ask it even if it doesn't fall into any of these categories. There is a chance it might, and you might inspire us to extend its capabilities in new directions.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* See some use case examples in [https://downloads.analytica.com/Videos/AI_Series/AAIA_alpha_demo.mp4| a short unpolished demo].&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61158</id>
		<title>What's new in Analytica 6.5?</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61158"/>
		<updated>2024-07-12T16:25:40Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Namespaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:What's new pages]]&lt;br /&gt;
The current release is [[Analytica 6.4]]. This page is describes new features in the next Analytica release.&lt;br /&gt;
&lt;br /&gt;
The Analytica 6.5 release introduces the '''[[Analytica A.I. Assistant]]'''. &lt;br /&gt;
&lt;br /&gt;
Analytica 6.5 is currently in '''''alpha testing'''''.  The alpha stage comes before the beta testing stage, which is when we usually make a preview release available to our users.  The pre-beta build(s) very likely contain serious instabilities. We discourage you from using or relying on the alpha build for your &amp;quot;real work&amp;quot;. We provide this early release in order to give early access to the A.I. assistant.  If you want to be an alpha tester, get started at the [[Beta Tester Page]].&lt;br /&gt;
&lt;br /&gt;
== Assista, the Analytica A.I. Assistant ==&lt;br /&gt;
&lt;br /&gt;
An exciting natural language assistant that can help with things like:&lt;br /&gt;
* How do you do X in Analytica?&lt;br /&gt;
* Can you do it for me?&lt;br /&gt;
* Where can I find more info on «Analytica topic»&lt;br /&gt;
* Write this description for me&lt;br /&gt;
* Show me «description of something or some result in the model»&lt;br /&gt;
&lt;br /&gt;
and much more, with increasing capabilities expected in the future.  Here is [https://downloads.analytica.com/Videos/AI_Series/AAIA_alpha_demo.mp4 a 7 minute unpolished demo video] with some examples.&lt;br /&gt;
&lt;br /&gt;
As of this build, an Analytica Enterprise or Optimizer license is required to use Assista. We intend to fix this shortly and make it available to Professional and Free users in a future build.&lt;br /&gt;
&lt;br /&gt;
== Web service integration ==&lt;br /&gt;
The [[ReadFromURL]] function, used to call external web services APIs, has been significantly extended to support:&lt;br /&gt;
* Asynchronous HTTP communications&lt;br /&gt;
* Ctrl+Break to interrupt it and Windows redraw events while waiting for a slow server response.&lt;br /&gt;
* Websocket connections.&lt;br /&gt;
* Streaming responses (Server-Sent Events, SSE).&lt;br /&gt;
&lt;br /&gt;
== Built-in functions ==&lt;br /&gt;
* New «warningNumber» parameter to [[IgnoreWarnings]]&lt;br /&gt;
* New system variable [[Sys_TopLevelModule]]&lt;br /&gt;
* A new «silent» flag to [[ConsolePrint]]. &lt;br /&gt;
* Flag to [[MakeJSON]] to render a local index name with a dot.&lt;br /&gt;
&lt;br /&gt;
== Namespaces ==&lt;br /&gt;
&lt;br /&gt;
It is possible to define a new Namespace for each module and library to prevent clashes when they contain identifiers that are the same as those in another module. Namespaces also let the modeler specify which object identifiers are public -- i.e. may be accessed from outside the module -- or private.  '''This is an incomplete feature, and so not an official part of the 6.5 release.'''  But it is used by the A.I. assistant client to keep its identifiers separate from your model's.  See [[Namespaces]].&lt;br /&gt;
&lt;br /&gt;
== Customizing DTA's UI ==&lt;br /&gt;
Advanced library authors can take advantage of some new customization features.&lt;br /&gt;
* Allows browse-only modules that aren't filed modules.&lt;br /&gt;
* Allows a library to add a menu item or a toolbar button.&lt;br /&gt;
* [[RegisterSelectionChangeHandler]] - a mechanism to track changes to what is selected in the UI.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* Less flashing during diagram redraws.&lt;br /&gt;
* The [[NameSize]] default changed from 20 to 40. This is the [[Preferences]] setting that controls the maximum number of characters in an identifier that is auto-generated from a title.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61157</id>
		<title>What's new in Analytica 6.5?</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61157"/>
		<updated>2024-07-12T16:23:26Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Namespaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:What's new pages]]&lt;br /&gt;
The current release is [[Analytica 6.4]]. This page is describes new features in the next Analytica release.&lt;br /&gt;
&lt;br /&gt;
The Analytica 6.5 release introduces the '''[[Analytica A.I. Assistant]]'''. &lt;br /&gt;
&lt;br /&gt;
Analytica 6.5 is currently in '''''alpha testing'''''.  The alpha stage comes before the beta testing stage, which is when we usually make a preview release available to our users.  The pre-beta build(s) very likely contain serious instabilities. We discourage you from using or relying on the alpha build for your &amp;quot;real work&amp;quot;. We provide this early release in order to give early access to the A.I. assistant.  If you want to be an alpha tester, get started at the [[Beta Tester Page]].&lt;br /&gt;
&lt;br /&gt;
== Assista, the Analytica A.I. Assistant ==&lt;br /&gt;
&lt;br /&gt;
An exciting natural language assistant that can help with things like:&lt;br /&gt;
* How do you do X in Analytica?&lt;br /&gt;
* Can you do it for me?&lt;br /&gt;
* Where can I find more info on «Analytica topic»&lt;br /&gt;
* Write this description for me&lt;br /&gt;
* Show me «description of something or some result in the model»&lt;br /&gt;
&lt;br /&gt;
and much more, with increasing capabilities expected in the future.  Here is [https://downloads.analytica.com/Videos/AI_Series/AAIA_alpha_demo.mp4 a 7 minute unpolished demo video] with some examples.&lt;br /&gt;
&lt;br /&gt;
As of this build, an Analytica Enterprise or Optimizer license is required to use Assista. We intend to fix this shortly and make it available to Professional and Free users in a future build.&lt;br /&gt;
&lt;br /&gt;
== Web service integration ==&lt;br /&gt;
The [[ReadFromURL]] function, used to call external web services APIs, has been significantly extended to support:&lt;br /&gt;
* Asynchronous HTTP communications&lt;br /&gt;
* Ctrl+Break to interrupt it and Windows redraw events while waiting for a slow server response.&lt;br /&gt;
* Websocket connections.&lt;br /&gt;
* Streaming responses (Server-Sent Events, SSE).&lt;br /&gt;
&lt;br /&gt;
== Built-in functions ==&lt;br /&gt;
* New «warningNumber» parameter to [[IgnoreWarnings]]&lt;br /&gt;
* New system variable [[Sys_TopLevelModule]]&lt;br /&gt;
* A new «silent» flag to [[ConsolePrint]]. &lt;br /&gt;
* Flag to [[MakeJSON]] to render a local index name with a dot.&lt;br /&gt;
&lt;br /&gt;
== Namespaces ==&lt;br /&gt;
&lt;br /&gt;
It is possible to define a new Namespace for each module and library to prevent clashes when they contain identifiers that are the same as those in another module. Namespaces also let the modeler specify which object identifiers are public -- i.e. may be accessed from outside the module -- or private.  '''This is an incomplete feature,''' and so not an official part of the 6.5 release. But it is used by the A.I. assistant client to keep its identifiers separate from your model's.  See [[Namespaces]].&lt;br /&gt;
&lt;br /&gt;
== Customizing DTA's UI ==&lt;br /&gt;
Advanced library authors can take advantage of some new customization features.&lt;br /&gt;
* Allows browse-only modules that aren't filed modules.&lt;br /&gt;
* Allows a library to add a menu item or a toolbar button.&lt;br /&gt;
* [[RegisterSelectionChangeHandler]] - a mechanism to track changes to what is selected in the UI.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* Less flashing during diagram redraws.&lt;br /&gt;
* The [[NameSize]] default changed from 20 to 40. This is the [[Preferences]] setting that controls the maximum number of characters in an identifier that is auto-generated from a title.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61156</id>
		<title>What's new in Analytica 6.5?</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=What%27s_new_in_Analytica_6.5%3F&amp;diff=61156"/>
		<updated>2024-07-12T16:19:06Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Web service integrations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:What's new pages]]&lt;br /&gt;
The current release is [[Analytica 6.4]]. This page is describes new features in the next Analytica release.&lt;br /&gt;
&lt;br /&gt;
The Analytica 6.5 release introduces the '''[[Analytica A.I. Assistant]]'''. &lt;br /&gt;
&lt;br /&gt;
Analytica 6.5 is currently in '''''alpha testing'''''.  The alpha stage comes before the beta testing stage, which is when we usually make a preview release available to our users.  The pre-beta build(s) very likely contain serious instabilities. We discourage you from using or relying on the alpha build for your &amp;quot;real work&amp;quot;. We provide this early release in order to give early access to the A.I. assistant.  If you want to be an alpha tester, get started at the [[Beta Tester Page]].&lt;br /&gt;
&lt;br /&gt;
== Assista, the Analytica A.I. Assistant ==&lt;br /&gt;
&lt;br /&gt;
An exciting natural language assistant that can help with things like:&lt;br /&gt;
* How do you do X in Analytica?&lt;br /&gt;
* Can you do it for me?&lt;br /&gt;
* Where can I find more info on «Analytica topic»&lt;br /&gt;
* Write this description for me&lt;br /&gt;
* Show me «description of something or some result in the model»&lt;br /&gt;
&lt;br /&gt;
and much more, with increasing capabilities expected in the future.  Here is [https://downloads.analytica.com/Videos/AI_Series/AAIA_alpha_demo.mp4 a 7 minute unpolished demo video] with some examples.&lt;br /&gt;
&lt;br /&gt;
As of this build, an Analytica Enterprise or Optimizer license is required to use Assista. We intend to fix this shortly and make it available to Professional and Free users in a future build.&lt;br /&gt;
&lt;br /&gt;
== Web service integration ==&lt;br /&gt;
The [[ReadFromURL]] function, used to call external web services APIs, has been significantly extended to support:&lt;br /&gt;
* Asynchronous HTTP communications&lt;br /&gt;
* Ctrl+Break to interrupt it and Windows redraw events while waiting for a slow server response.&lt;br /&gt;
* Websocket connections.&lt;br /&gt;
* Streaming responses (Server-Sent Events, SSE).&lt;br /&gt;
&lt;br /&gt;
== Built-in functions ==&lt;br /&gt;
* New «warningNumber» parameter to [[IgnoreWarnings]]&lt;br /&gt;
* New system variable [[Sys_TopLevelModule]]&lt;br /&gt;
* A new «silent» flag to [[ConsolePrint]]. &lt;br /&gt;
* Flag to [[MakeJSON]] to render a local index name with a dot.&lt;br /&gt;
&lt;br /&gt;
== Namespaces ==&lt;br /&gt;
Incomplete feature, and thus not an official part of the 6.5 release. But it is used by the A.I. assistant client to keep its identifiers separate from your model's.  See [[Namespaces]].&lt;br /&gt;
&lt;br /&gt;
== Customizing DTA's UI ==&lt;br /&gt;
Advanced library authors can take advantage of some new customization features.&lt;br /&gt;
* Allows browse-only modules that aren't filed modules.&lt;br /&gt;
* Allows a library to add a menu item or a toolbar button.&lt;br /&gt;
* [[RegisterSelectionChangeHandler]] - a mechanism to track changes to what is selected in the UI.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* Less flashing during diagram redraws.&lt;br /&gt;
* The [[NameSize]] default changed from 20 to 40. This is the [[Preferences]] setting that controls the maximum number of characters in an identifier that is auto-generated from a title.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Beta_Tester_Page&amp;diff=61155</id>
		<title>Beta Tester Page</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Beta_Tester_Page&amp;diff=61155"/>
		<updated>2024-07-12T16:14:24Z</updated>

		<summary type="html">&lt;p&gt;Max: change wiki to docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Category: Beta testing]]&lt;br /&gt;
&lt;br /&gt;
{{#svarset:betarelease|6.5}}&lt;br /&gt;
{{#svarset:prevrelease|6.4}}&lt;br /&gt;
&lt;br /&gt;
If you have an Analytica Enterprise or Optimizer license, then we invite you to try out the new [[Analytica A.I. Assistant]] and other new [[Analytica {{#svarget:betarelease}}]] enhancements with this early '''''alpha''''' build of [[Analytica 6.5]]. Just please beware that this is alpha, and is not at the beta-quality stability level yet. We are making this build available earlier than usual so that you can try out the A.I. assistant. Also keep in mind that the A.I. assistant is going to get better rapidly.&lt;br /&gt;
&lt;br /&gt;
If you have an Analytica Professional license, you won't be able to use the [[Analytica A.I. Assistant|A.I. Assistant]] yet, but check back. We intend to get it working in Professional too, we just have some remaining technical challenges to get that working.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--We invite you to be a beta tester of [[Analytica {{#svarget:betarelease}}]] if you have Analytica {{#svarget:prevrelease}} installed on your computer with an active subscription. (Sorry, not [[Analytica Free Edition]] and not a legacy permanent license). A floating license subscription works.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &amp;lt;span style=&amp;quot;font-size: 20px;color:blue;&amp;quot;&amp;gt;We are no longer in beta testing.&amp;lt;/span&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The beta testing period for [[Analytica {{#svarget:prevrelease}}]] has ended and [[Analytica {{#svarget:betarelease}}]] is now the current release!  Please visit the [https://analytica.com/support-2/analytica-downloads/ Analytica Downloads] page to get the latest.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The beta testing period for [[Analytica {{#svarget:betarelease}}]] will start very soon. Please check this page for updates.&lt;br /&gt;
&lt;br /&gt;
When the next release goes into beta testing, this page will be updated.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why become a beta tester? ==&lt;br /&gt;
&lt;br /&gt;
* Test drive the upcoming release {{#svarget:betarelease}} and start using its [[Analytica {{#svarget:betarelease}}|new features]] immediately.&lt;br /&gt;
* Participate in webinars on tips and guides on new features.&lt;br /&gt;
* Help improve the final release. &lt;br /&gt;
* Check that your models work in the new release. Find any issues while they can still be fixed, ensuring a seamless transition for you and your model users when this release becomes official.&lt;br /&gt;
&lt;br /&gt;
== As a beta tester, we request that you ==&lt;br /&gt;
&lt;br /&gt;
* Read [[What's new in Analytica {{#svarget:betarelease}}?]] for an overview of the new features.&lt;br /&gt;
* Sign up as a beta tester by filling in the form when you run the installer.&lt;br /&gt;
* Try out the new Analytica enhancements of interest to you.&lt;br /&gt;
* [[Beta_Tester_Page/Submitting_a_Bug_Report|Submit a bug report]]  if you find an issue&lt;br /&gt;
* Keep up-to-date with the latest beta build.  Analytica will show you an alert whenever there is a new build ready to install, about every 2 weeks.  We may also send you email reminders.   See [[Analytica {{#svarget:betarelease}} beta Release Notes| release notes]] for changes and bug fixes in each beta release.&lt;br /&gt;
* We encourage you to retain Analytica {{#svarget:prevrelease}} when you install Analytica {{#svarget:betarelease}}  beta. That lets you compare their behavior if you suspect a new bug.&lt;br /&gt;
&lt;br /&gt;
== How to start beta-testing ==&lt;br /&gt;
&lt;br /&gt;
Download the installer for the latest beta build, release number 6.5.2.250, from:&lt;br /&gt;
* [https://downloads.Analytica.com/ANA6.5/AnaSetup6_5_2_250.exe Analytica {{#svarget:betarelease}} installer]&lt;br /&gt;
&amp;lt;!--* [https://downloads.Analytica.com/ANA6.4/AdeSetup6_4_5_237.exe ADE]--&amp;gt;&lt;br /&gt;
These beta builds use your existing {{#svarget:prevrelease}} subscription license that is already on your computer. A separate beta license is not required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The installers can be downloaded directly from the [https://analytica.com/support-2/analytica-downloads/ Analytica Downloads] page.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Improve Analytica docs ==&lt;br /&gt;
&lt;br /&gt;
During the alpha and beta testing period, we are still updating these Analytica Docs to reflect new features. [[What's new in Analytica {{#svarget:betarelease}}?]] is the most complete listing of new features, and is also a work in progress. As we approach final release date, this information will be more complete.&lt;br /&gt;
&lt;br /&gt;
As an Analytica user, you are invited to contribute to the docs! Since it's on a wiki (using Mediawiki software, just like Wikipedia), you can add or edit any content.  If you find something unclear, incomplete, or just wrong, feel free to fix it yourself. Or add comments, asking someone else to.  And you are welcome to add tips or interesting examples.&lt;br /&gt;
&lt;br /&gt;
== Known issues ==&lt;br /&gt;
&lt;br /&gt;
If you find an issue, please let us know about it at &amp;lt;code&amp;gt;support@lumina.com&amp;lt;/code&amp;gt;. Please see [[/Submitting a Bug Report|Submitting a bug report]] for instructions on reporting bugs.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' We list only the most important issues here (ones that might impact your ability to use it, or which are likely to be found and reported multiple times). We maintain a comprehensive bug base in-house, which is not accessible outside of Lumina.&lt;br /&gt;
&lt;br /&gt;
== FAQs: Frequently Asked Questions ==&lt;br /&gt;
&lt;br /&gt;
See [[Analytica User FAQs]] for frequently asked questions not specific to {{#svarget:betarelease}} or to beta testing.&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Filed_modules_and_libraries&amp;diff=61055</id>
		<title>Filed modules and libraries</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Filed_modules_and_libraries&amp;diff=61055"/>
		<updated>2024-06-27T20:25:16Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Concepts]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Working with Large Models &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Model may contain several Modules (including Libraries, which are a subclass of Modules). Usually, Modules and Libraries are embedded in the file of their parent Model, but it is also possible to include them in separate files, known as '''Filed (or linked) Modules and Libraries.  This page describes these different classes of Module, and how to create, save, import, and remove them.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Module Classes ===&lt;br /&gt;
&lt;br /&gt;
Technically, Module is a [[Class]] of Object. Model and Library are subclasses of the Module class. Each Module (including a Model or Library) is simply a collection of variables and other objects. It has a Diagram view, displaying the objects arranged as nodes with arrows indicating dependencies. It may contain submodules, defining a nested hierarchy of Modules. The Module hierarchy provides a convenient way to organize a complex model, perhaps with hundreds or thousands of variables and other objects.  &lt;br /&gt;
&lt;br /&gt;
There are six types of ''module'':&lt;br /&gt;
* '''Model''': A top level Module, always saved in a separate file. &lt;br /&gt;
* '''Module''': A plain Module that is embedded in its parent Model or other Module.&lt;br /&gt;
* '''Filed Module''': A Module used in a parent Model or other Module, but saved in its own file.&lt;br /&gt;
* '''Library''':  A Module that contains Functions and/or other objects designed for use in multiple Models. &lt;br /&gt;
* '''Filed Library''': A library saved in its own file.  Analytica is distributed with a set of [[standard libraries]] of this kind. You can also create your own [[User-defined Functions and Libraries|Libraries]] for use by yourself and others.&lt;br /&gt;
* '''Form''': A special class of Module that makes it easy to add [[User Input nodes]], and [[User Output nodes]], simply by drawing arrows from a variable to the Form Node, or from the Form Node to a variable, respectively.&lt;br /&gt;
&lt;br /&gt;
The only difference between a Filed Module or Library and a Module or Library embedded in its parent Model is that it is saved as a separate file.   When you add a filed Module or Library into a Model, it gives you the choice of keeping it in a separate file or embedding it in the Model file. It's usually best to embed it so that you don't have to remember to include the separate files when you move the Model or share it with other people.  &lt;br /&gt;
&lt;br /&gt;
If you leave a module as a separate file, any changes you make to it will also affect any other Models that also link to this filed Module or Library.  Sometimes this is useful, for example when several people are working on a Model in parallel, and you want them all to benefit from your improvements.  For the same reason, it is dangerous because any change that anyone makes to the filed Module will affect all Models that use it.&lt;br /&gt;
&lt;br /&gt;
=== Add a Module or Library to a Model === &lt;br /&gt;
&lt;br /&gt;
To add a filed Module or Library to the active Model, use the [[Import a module or library|Add Module dialog]] from the [[File menu]].  It prompts you for the directory and file. If instead, you select '''Add Library''' from the [[File menu]], the file dialog defaults to the directory containing the [[Standard libraries]] distributed with Analytica. &lt;br /&gt;
&lt;br /&gt;
Either way, it gives you the choice to embed the Module or Library into the parent Model or to link to the file.&lt;br /&gt;
&lt;br /&gt;
=== Remove a filed Module or Library from a Model === &lt;br /&gt;
&lt;br /&gt;
To remove a Module or Library from a Model, first select it. Then, select '''Cut''' or '''Clear''' from the [[Edit menu]], or press the ''delete'' key. If it was embedded, it deletes it. If it was filed, it deletes only the node and link from the parent Module, but not the separate file.&lt;br /&gt;
&lt;br /&gt;
=== To create a library or filed module or library ===&lt;br /&gt;
&lt;br /&gt;
The [[toolbar|Node toolbar]] offers only a standard embedded Module. To make a separately filed Module, Library, or Form, you first create a standard Module and then change its class to what you want.&lt;br /&gt;
&lt;br /&gt;
# Create a module by dragging the module icon from the node palette onto the diagram, and give it a title.&lt;br /&gt;
# Create variables, functions and  any other objects in the new module, or, if they already exist, drag them into the module.&lt;br /&gt;
# [[To_change_the_class_of_an_object|Change the class]] of the module &lt;br /&gt;
# If you change the class to a separately filed '''Module''' [[File:Chapter19_14.png]] or '''Library''' [[File:Chapter19_15.png]], a file browser dialog prompts you for a directory and file name.&lt;br /&gt;
# If you want the parent Model to load the new filed Module or Library the next time it is opened, use the '''Save''' command from the [[File menu]] to make sure it saves the link to the new file.&lt;br /&gt;
&lt;br /&gt;
===Changing Module Class===&lt;br /&gt;
&lt;br /&gt;
You can change the Class of a Module to another Module Class, including from embedded to filed or vice versa, in the same way that you change the Class of a Variable. (You can't change a Module into a Variable or other non-Module class, or vice versa.) Show its Class in its [[Object Window]], or [[Attribute pane]]. In Edit mode, press on the Class menu and select another Class.  &lt;br /&gt;
&lt;br /&gt;
If you change from an embedded to Filed Class, e.g. from Library to Filed Library, it a File browser prompts you to select the file name and directory. &lt;br /&gt;
&lt;br /&gt;
=== Saving changes ===  &lt;br /&gt;
&lt;br /&gt;
After you have linked to a filed module or library, the '''Save''' option from the [[File menu]] saves every filed module and library that has changed, as well as the model containing them, in their corresponding files. The '''Save As''' and '''Save A Copy''' options save only the active (topmost window’s) model, filed module or filed library, but not any submodules it may contain.&lt;br /&gt;
&lt;br /&gt;
===Using a Module to Copy stuff from one Model to Another===&lt;br /&gt;
&lt;br /&gt;
Analytica doesn't let you copy and paste objects directly from one Model to another.  Here's how to copy variables, functions, modules, or any objects  from a model M1 into another model M2:&lt;br /&gt;
#Open Model M1.&lt;br /&gt;
#Create a new Module by dragging from the Toolbar, and give it a title, say &amp;quot;From M1&amp;quot;.&lt;br /&gt;
#Drag all the objects you want to copy into that Module.&lt;br /&gt;
#Open the [[Attribute panel]] (if needed) by clicking on the key icon at the bottom left corner of the window.&lt;br /&gt;
#Select the node for module &amp;quot;From M1&amp;quot;&lt;br /&gt;
#Change the [[Attribute panel]] to the ''Class'' view, to show its current class &amp;quot;Module&amp;quot;&lt;br /&gt;
#Open the ''Class'' menu and select Filed Module (with page icon inside the module icon) [[File:SelectClass.jpg]]&lt;br /&gt;
#When it prompts to save the Module, select the file name (or use the default).&lt;br /&gt;
#Now open Model M1&lt;br /&gt;
#In Edit mode, select '''Add module...''' from the [[File menu]], and select module &amp;quot;From M1.ana&amp;quot;. &lt;br /&gt;
#In the '''Add module or library''' dialog, select '''Embed a model''', but leave '''Merge contents''' unchecked.&lt;br /&gt;
This reads  &amp;quot;From M1.ana&amp;quot; to become a new module into M2. With &amp;quot;Merge contents&amp;quot; unchecked, if any imported object has the same identifier as an existing object in M2, it adds a digit at the end of its identifier, to make no existing object gets overwritten.&lt;br /&gt;
&lt;br /&gt;
=== Managing multiple versions of a model ===&lt;br /&gt;
&lt;br /&gt;
There are several reasons you might need to manage multiple versions of a model:&lt;br /&gt;
# While you are developing a model, you want to explore alternative ways to structure it. In this case, it's a good idea to make sure the parts for which you want to try different versions are all in the same module, and the parts that won't change are outside it. That way, once you've explored the variations, you can more easily remember what's changed and what's haven't.&lt;br /&gt;
# Similarly, when two or more modelers work on a model in parallel, it's best to agree on who can make changes to which module(s) before you fork the model (start multiple versions). Then you can change those modules to be separately filed. Usually one person takes responsibility for the parent model.  Analytica doesn't have a built-in way to prevent &amp;quot;unauthorized&amp;quot; changes to a module, except by saving it as &amp;quot;Browse-only&amp;quot;. But you can lock a module using the Windows explorer (see below.) When you recombine the modules (merge them) you can simply copy the changed modules into the same folder as the parent model. When you restart the parent model it will automatically read in the new module versions. At that point you can decide if you want to change them back from separately filed to integrated modules.&lt;br /&gt;
# A great way to support multiple modelers and multiple model versions is to use  '''Github''', the widely used software source code management tool.  Analytica works well with Github. That allows multiple modelers to work simultaneously on the same modules. It tracks who made what changes and makes it easy to compare versions.  When you want to merge changes, you can see each change and decide  which version of each change you want to use. &lt;br /&gt;
# Sometimes you want to create several versions of a model for different applications . One approach is to put all the variables, functions, and so on that are common to all the applications into a separately filed module, and keep the things that change from one version to another in the parent model.&lt;br /&gt;
&lt;br /&gt;
=== Module Attributes ===&lt;br /&gt;
&lt;br /&gt;
Each Module has standard attributes common to any Object, including Identifier, Title, and Description, plus Author(s). If it is a separately filed Module or Library, it also contains Created date, Last Saved date, and File info, containing its file path and name, like a Model object.  You can see these in its [[Object Window]].&lt;br /&gt;
&lt;br /&gt;
=== Locking a filed module or library ===&lt;br /&gt;
&lt;br /&gt;
You can use the Windows explorer to lock a filed module or library to prevent users from modifying it, even which they can modify things in a parent model that uses it:&lt;br /&gt;
#  Close the filed module or library, or close Analytica.&lt;br /&gt;
#  In Windows Explorer, select the filed module or library.&lt;br /&gt;
#  Select '''Properties''' from the [[File menu]]. &lt;br /&gt;
#:[[File:Chapter19_16.png]]&lt;br /&gt;
# Check the ''Read-only'' checkbox.&lt;br /&gt;
# Close the '''Properties''' window&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Modules and Libraries]]&lt;br /&gt;
* [[Standard libraries]]&lt;br /&gt;
* [[Additional libraries]]&lt;br /&gt;
* [[User Libraries]]&lt;br /&gt;
* [[User-defined Functions and Libraries]]&lt;br /&gt;
* [[Analytica Libraries and Templates]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Obfuscated and Browse-Only Models]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Invalid variables / {{PAGENAME}} / Import a module or library&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Filed_modules_and_libraries&amp;diff=61054</id>
		<title>Filed modules and libraries</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Filed_modules_and_libraries&amp;diff=61054"/>
		<updated>2024-06-27T19:48:19Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Managing multiple versions of a model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Analytica User Guide]]&lt;br /&gt;
[[Category: Concepts]]&lt;br /&gt;
&amp;lt;breadcrumbs&amp;gt;Analytica User Guide &amp;gt; Working with Large Models &amp;gt; {{PAGENAME}}&amp;lt;/breadcrumbs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Model may contain Modules and  Libraries. A Library contains functions and other objects for use in other models.  Usually, Modules and Libraries are embedded in the file of their parent Model, but it is also possible to include them in separate files, known as filed (or linked) Modules and  Libraries.  This page describes these different classes of Module, and how to create, save, import, and remove them.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Module Classes ===&lt;br /&gt;
&lt;br /&gt;
Technically, Module is a [[Class]] of Object. Model and Library are subclasses of the Module class. Each Module (including a Model or Library) is simply a collection of variables and other objects. It has a Diagram view, displaying the objects arranged as nodes with arrows indicating dependencies. It may contain submodules, defining a nested hierarchy of Modules. The Module hierarchy provides a convenient way to organize a complex model, perhaps with hundreds or thousands of variables and other objects.  &lt;br /&gt;
&lt;br /&gt;
There are six types of ''module''a:&lt;br /&gt;
* '''Model''': A top level Module, always saved in a separate file. &lt;br /&gt;
* '''Module''': A plain Module that is embedded in its parent Model or other Module.&lt;br /&gt;
* '''Filed Module''': A Module used in a parent Model or other Module, but saved in its own file.&lt;br /&gt;
* '''Library''':  A Module that contains Functions and/or other objects designed for use in multiple Models. &lt;br /&gt;
* '''Filed Library''': A library saved in its own file.  Analytica is distributed with a set of [[standard libraries]] of this kind. You can also create your own [[User-defined Functions and Libraries|Libraries]] for use by yourself and others.&lt;br /&gt;
* '''Form''': A special class of Module that makes it easy to add [[User Input nodes]], and [[User Output nodes]], simply by drawing arrows from a variable to the Form Node, or from the Form Node to a variable, respectively.&lt;br /&gt;
&lt;br /&gt;
The only difference between a Filed Module or Library and a Module or Library embedded in its parent Model is that it is saved as a separate file.   When you add a filed Module or Library into a Model, it gives you the choice of keeping it in a separate file or embedding it in the Model file. It's usually best to embed it so that you don't have to remember to include the separate files when you move the Model or share it with other people.  &lt;br /&gt;
&lt;br /&gt;
If you leave it a separate file, any changes you make to it will also affect any other Models that also link to this filed Module or Library.  Sometimes this is useful, for example when several people are working on a Model in parallel, and you want them all to benefit from your improvements.  For the same reason, it is dangerous because any change that you or anyone makes to the same copy of filed Module will affect all Models that use it.&lt;br /&gt;
&lt;br /&gt;
=== Add a Module or Library to a Model === &lt;br /&gt;
&lt;br /&gt;
To add a filed Module or Library to the active Model, use the [[Import a module or library|Add Module dialog]] from the [[File menu]].  It prompts you for the directory and file. If instead, you select '''Add Library''' from the [[File menu]], the file dialog defaults to the directory containing the [[Standard libraries]] distributed with Analytica. &lt;br /&gt;
&lt;br /&gt;
Either way, it gives you the choice to embed the Module or Library into the parent Model or to link to the file.&lt;br /&gt;
&lt;br /&gt;
=== Remove a filed Module or Library from a Model === &lt;br /&gt;
&lt;br /&gt;
To remove a Module or Library from a Model, first select it. Then, select '''Cut''' or '''Clear''' from the [[Edit menu]], or press the ''delete'' key. If it was embedded, it deletes it. If it was filed, it deletes only the node and link from the parent Module, but not the separate file.&lt;br /&gt;
&lt;br /&gt;
=== To create a library or filed module or library ===&lt;br /&gt;
&lt;br /&gt;
The [[toolbar|Node toolbar]] offers only a standard embedded Module. To make a separately filed Module, Library, or Form, you first create a standard Module and then change its class to what you want.&lt;br /&gt;
&lt;br /&gt;
# Create a module by dragging the module icon from the node palette onto the diagram, and give it a title.&lt;br /&gt;
# Create variables, functions and  any other objects in the new module, or, if they already exist, drag them into the module.&lt;br /&gt;
# [[To_change_the_class_of_an_object|Change the class]] of the module &lt;br /&gt;
# If you change the class to a separately filed '''Module''' [[File:Chapter19_14.png]] or '''Library''' [[File:Chapter19_15.png]], a file browser dialog prompts you for a directory and file name.&lt;br /&gt;
# If you want the parent Model to load the new filed Module or Library the next time it is opened, use the '''Save''' command from the [[File menu]] to make sure it saves the link to the new file.&lt;br /&gt;
&lt;br /&gt;
===Changing Module Class===&lt;br /&gt;
&lt;br /&gt;
You can change the Class of a Module to another Module Class, including from embedded to filed or vice versa, in the same way that you change the Class of a Variable. (You can't change a Module into a Variable or other non-Module class, or vice versa.) Show its Class in its [[Object Window]], or [[Attribute pane]]. In Edit mode, press on the Class menu and select another Class.  &lt;br /&gt;
&lt;br /&gt;
If you change from an embedded to Filed Class, e.g. from Library to Filed Library, it a File browser prompts you to select the file name and directory. &lt;br /&gt;
&lt;br /&gt;
=== Saving changes ===  &lt;br /&gt;
&lt;br /&gt;
After you have linked to a filed module or library, the '''Save''' command saves every filed module and library that has changed, as well as the model containing them, in their corresponding files. The '''Save As''' and '''Save A Copy''' In commands save only the active (topmost window’s) model, filed module or filed library.&lt;br /&gt;
&lt;br /&gt;
===Using a Module to Copy stuff from one Model to Another===&lt;br /&gt;
&lt;br /&gt;
Analytica doesn't let you copy and paste objects directly from one Model to another.  Here is a way to copy variables, functions, modules, or any objects  from a model M1 into another model M2:&lt;br /&gt;
#Open Model M1.&lt;br /&gt;
#Create a new Module by dragging from the Toolbar, and give it a title, say &amp;quot;From M1&amp;quot;.&lt;br /&gt;
#Drag all the objects you want to copy into that Module.&lt;br /&gt;
#Open the [[Attribute panel]] (if needed) by clicking on the key icon at the bottom left corner of the window.&lt;br /&gt;
#Select the node for module &amp;quot;From M1&amp;quot;&lt;br /&gt;
#Change the [[Attribute panel]] to the ''Class'' view, to show its current class &amp;quot;Module&amp;quot;&lt;br /&gt;
#Open the ''Class'' menu and select Filed Module (with page icon inside the module icon) [[File:SelectClass.jpg]]&lt;br /&gt;
#When it prompts to save the Module, select the file name (or use the default).&lt;br /&gt;
#Now open Model M1&lt;br /&gt;
#In Edit mode, select '''Add module...''' from the [[File menu]], and select module &amp;quot;From M1.ana&amp;quot;. &lt;br /&gt;
#In the '''Add module or library''' dialog, select '''Embed a model''', but leave '''Merge contents''' unchecked.&lt;br /&gt;
This reads  &amp;quot;From M1.ana&amp;quot; to become a new module into M2. With &amp;quot;Merge contents&amp;quot; unchecked, if any imported object has the same identifier as an existing object in M2, it adds a digit at the end of its identifier, to make no existing object gets overwritten.&lt;br /&gt;
&lt;br /&gt;
=== Managing multiple versions of a model ===&lt;br /&gt;
&lt;br /&gt;
There are several reasons you might need to manage multiple versions of a model:&lt;br /&gt;
# While you are developing a model, you want to explore alternative ways to structure it. In this case, it's a good idea to make sure the parts for which you want to try different versions are all in the same module, and the parts that won't change are outside it. That way, once you've explored the variations, you can more easily remember what's changed and what's haven't.&lt;br /&gt;
# Similarly, when two or more modelers work on a model in parallel, it's best to agree on who can make changes to which module(s) before you fork the model (start multiple versions). Then you can change those modules to be separately filed. Usually one person takes responsibility for the parent model.  Analytica doesn't have a built-in way to prevent &amp;quot;unauthorized&amp;quot; changes to a module, except by saving it as &amp;quot;Browse-only&amp;quot;. But you can lock a module using the Windows explorer (see below.) When you recombine the modules (merge them) you can simply copy the changed modules into the same folder as the parent model. When you restart the parent model it will automatically read in the new module versions. At that point you can decide if you want to change them back from separately filed to integrated modules.&lt;br /&gt;
# A great way to support multiple modelers and multiple model versions is to use  '''Github''', the widely used software source code management tool.  Analytica works well with Github. That allows multiple modelers to work simultaneously on the same modules. It tracks who made what changes and makes it easy to compare versions.  When you want to merge changes, you can see each change and decide  which version of each change you want to use. &lt;br /&gt;
# Sometimes you want to create several versions of a model for different applications . One approach is to put all the variables, functions, and so on that are common to all the applications into a separately filed module, and keep the things that change from one version to another in the parent model.&lt;br /&gt;
&lt;br /&gt;
=== Module Attributes ===&lt;br /&gt;
&lt;br /&gt;
Each Module has standard attributes common to any Object, including Identifier, Title, and Description, plus Author(s). If it is a separately filed Module or Library, it also contains Created date, Last Saved date, and File info, containing its file path and name, like a Model object.  You can see these in its [[Object Window]].&lt;br /&gt;
&lt;br /&gt;
=== Locking a filed module or library ===&lt;br /&gt;
&lt;br /&gt;
You can use the Windows explorer to lock a filed module or library to prevent users from modifying it, even which they can modify things in a parent model that uses it:&lt;br /&gt;
#  Close the filed module or library, or close Analytica.&lt;br /&gt;
#  In Windows Explorer, select the filed module or library.&lt;br /&gt;
#  Select '''Properties''' from the [[File menu]]. &lt;br /&gt;
#:[[File:Chapter19_16.png]]&lt;br /&gt;
# Check the ''Read-only'' checkbox.&lt;br /&gt;
# Close the '''Properties''' window&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Modules and Libraries]]&lt;br /&gt;
* [[Standard libraries]]&lt;br /&gt;
* [[Additional libraries]]&lt;br /&gt;
* [[User Libraries]]&lt;br /&gt;
* [[User-defined Functions and Libraries]]&lt;br /&gt;
* [[Analytica Libraries and Templates]]&lt;br /&gt;
* [[Example Models and Libraries]]&lt;br /&gt;
* [[Obfuscated and Browse-Only Models]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;footer&amp;gt;Invalid variables / {{PAGENAME}} / Import a module or library&amp;lt;/footer&amp;gt;&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61052</id>
		<title>Color Themes Library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61052"/>
		<updated>2024-06-25T19:00:43Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Apple example node styles as default style */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use the '''Color Themes Library''' to quickly update your diagram and graph styles with some new and updated preset themes! Simply add the '''Color Themes Library''' into your model to update your model’s theme.&lt;br /&gt;
&lt;br /&gt;
When you open the '''Color Themes Library''', you’ll see the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:Colorthemeslibrary.jpg|alt=|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
The '''Color Themes Library''' shows examples of each node class, including text, picture, form, and slider defaults as well as an Example Diagram to show how the selected theme looks. To the right of the example nodes there is a button '''Apply example node styles as default style'''. Under these examples there is a '''Select Diagram Theme''' menu which allows you to select theme and other options, and to the right of that menu there is an '''Additional Settings''' module and two buttons, '''Set all nodes to default color and border styles''' and '''Export Anastyle'''. At the bottom of the window is the '''Graph Examples''' menu which allows you to select graph themes and see examples of the selected settings on various graph types. &lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
You can download the Color Themes Library here: [[Media:Color Themes Library.ana|Color Themes Library.ana]]. To use it, simply add the library into your model. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Nodes and graphs that already have non-default options selected will not update when defaults are changed. If you have nodes with explicit color and style settings that you would like to revert to model defaults, use the '''Set all nodes to default color and border styles''' button at the bottom right of the library.&lt;br /&gt;
* Arrow border colors will only change in Analytica versions 6.3.0 or newer&lt;br /&gt;
* [[Slider|Slider bars]] (and styles) will only display in Analytica versions 6.3.0 or newer&lt;br /&gt;
* Bar graph outlines will only change in Analytica versions 5.0.7 or newer&lt;br /&gt;
&lt;br /&gt;
== Make a new style ==&lt;br /&gt;
&lt;br /&gt;
[[File:Colorthemeslibrary examplenodes.png|892x892px]]&lt;br /&gt;
&lt;br /&gt;
In Edit Mode you can change the colors and other styles of these example nodes at the top of the library diagram. Use the [[Color palette]] and [[Node Style dialog]]. Once you've set the styles you want, click the '''Apply example node styles as default style''' button to set these styles as the model default style. They will apply to all nodes in the model (except any that have their own nondefault styles). You can then export these styles as an Anastyle using the '''Export Anastyle''' button at the bottom of the library window, so you can easily apply them to other models. &lt;br /&gt;
&lt;br /&gt;
Note that the font styles of these nodes will '''not''' be applied to the default style. The default model font is set in the [[Diagram Style dialog]].&lt;br /&gt;
&lt;br /&gt;
Any changes made to these nodes and the default style will be reset if you select different Diagram colors in the '''Select Diagram Theme''' menu below.&lt;br /&gt;
&lt;br /&gt;
== Select Diagram Theme Menu ==&lt;br /&gt;
[[File:Selectdiagramtheme.png|alt=|frameless]]&lt;br /&gt;
&lt;br /&gt;
Use the '''Select Diagram Theme''' menu to update your model’s default theme options. This menu includes the following options:&lt;br /&gt;
&lt;br /&gt;
* Diagram colors&lt;br /&gt;
* Node borders&lt;br /&gt;
* Font size&lt;br /&gt;
* Font&lt;br /&gt;
&lt;br /&gt;
==== Diagram colors ====&lt;br /&gt;
The '''Diagram colors''' drop-down select menu allows you to select one of our preset themes. Changing this menu automatically updates model defaults to the selected theme. &lt;br /&gt;
&lt;br /&gt;
The available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Diagram Color Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:2023darktheme.png|alt=2023 Dark Colors Theme|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Classictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Monochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Viridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Plasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
See the [https://lumina.com/behind-the-scenes-5-3-color-themes/ Lumina Blog] for insight on how the Viridis and Plasma themes were designed.&lt;br /&gt;
&lt;br /&gt;
==== Node borders ====&lt;br /&gt;
Use the '''Node borders''' option to select node border style.  &lt;br /&gt;
&lt;br /&gt;
Select ''None'' to turn off node borders. Selecting this option will also toggle borders on and off in graphs. ''Monochrome'' sets a single border color for all nodes and ''Color'' sets custom border colors depending on each nodes’ color. See the table below for examples of the options:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Examples of nodes with different Node borders options&lt;br /&gt;
!None&lt;br /&gt;
!Monochrome&lt;br /&gt;
!Color&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Examplediagramnoborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithstandardborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithnodecolorborders.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
Some themes will automatically update the Include borders option to the selected theme’s  default when you change themes, but this option can still be changed according to your tastes. &lt;br /&gt;
&lt;br /&gt;
==== Font Size ====&lt;br /&gt;
The '''Font size''' menu allows you to change the font size of your model. This will affect the text and tables in diagrams, graphs, Object View, and Result View.&lt;br /&gt;
&lt;br /&gt;
==== Font  ====&lt;br /&gt;
The '''Font''' menu allows you to change the font of your model. This will affect the text in diagrams and graphs.&lt;br /&gt;
&lt;br /&gt;
== Graph Examples Menu ==&lt;br /&gt;
[[File:Graphexamplesmenu.png|frameless|512x512px]]&lt;br /&gt;
&lt;br /&gt;
The '''Graph Examples''' menu allows you to change your graph theme and view various example graphs. By default, the S'''ame diagram and graph themes''' option is selected and graphs will match the selected '''Diagram colors'''. &lt;br /&gt;
&lt;br /&gt;
If you uncheck the '''Same diagram and graph themes''' option, several menus will appear on the right hand side of the menu. The '''Graph theme''' drop-down menu provides a list of graph theme options for you to choose from. The '''Graph font size''' drop-down menu will change the font size in graphs. And the '''Include graph borders''' checkbox allows you to toggle borders on and off in graphs. Changing these selections will update the graph settings accordingly. &lt;br /&gt;
&lt;br /&gt;
Click the Result icon ([[File:VirtButtonBareIcon6.0.png]]) for each graph type to see an example.&lt;br /&gt;
&lt;br /&gt;
Examples of the available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Graph Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:Graphin2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:Graphin2023darktheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!2023 Rainbow&lt;br /&gt;
[[File:Graphin2023rainbowtheme.png|frameless]]&lt;br /&gt;
!2023 Dark Rainbow&lt;br /&gt;
[[File:Graphin2023darkrainbowgraphtheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Graphinclassictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Graphinmonochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Graphinviridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Graphinplasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set all nodes to default color and border styles ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is a '''Set all nodes to default color and border styles''' button. Nodes with explicit colors and styles will not update when model defaults are changed. This button reset all nodes with explicit colors and styles so they will use the defaults, ''i.e.'', the colors from the selected theme, again. &lt;br /&gt;
&lt;br /&gt;
== Export Anastyle ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is an '''Export Anastyle''' button. Clicking on this button will save the current model's default diagram and graph theme options into an [[Anastyles|Anastyle]] file that can be imported into other models. This way you can easily import your selected options into other models without having to import the '''Color Themes Library''' and select your options again. You can import an Anastyle file to a model the same way you would add a Library into a model.&lt;br /&gt;
&lt;br /&gt;
See [[Anastyles]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Additional Settings ==&lt;br /&gt;
[[File:Colorthemeslibrary additionalsettings.png|617x617px]]&lt;br /&gt;
&lt;br /&gt;
The '''Additional Settings''' module is located on the right hand side of the library under the example nodes. Open this module to access Arrow Settings and Corner Settings. &lt;br /&gt;
&lt;br /&gt;
=== Arrow Settings ===&lt;br /&gt;
The Arrow settings menu allows you to change the default size and color of arrows. &lt;br /&gt;
&lt;br /&gt;
Use the '''Arrow size''' drop-down select menu to change the arrow size.&lt;br /&gt;
&lt;br /&gt;
Change the arrow color by changing the color of the '''Arrow color''' node, then pressing the '''Apply color''' button beneath it. Your selected color will not be applied as the default color until you press the '''Apply color''' button. Note that you must be in Edit mode to change the Arrow color node. If you are in Edit mode, you can open the Color Palette by right-clicking on the Arrow color node and selecting Show/Hide Color Palette.&lt;br /&gt;
&lt;br /&gt;
=== Corner Settings ===&lt;br /&gt;
The Corner Settings menu allows you to change the default corner radius of certain objects. &lt;br /&gt;
&lt;br /&gt;
Use the '''Set corner radius to''' drop-down select menu to select a corner radius. The Null option selects the system default corner radius. &lt;br /&gt;
&lt;br /&gt;
Use the '''For object types''' multi-choice select menu to select which objects the corner radius settings should apply to. Options include Text nodes, Frame nodes, User inputs and outputs, and Buttons.&lt;br /&gt;
&lt;br /&gt;
== Reverting to the Classic Theme ==&lt;br /&gt;
If you’re using the '''Color Themes Library''' and would like to go back to the Classic Analytica theme, you can simply select the Classic diagram colors and graph theme options.&lt;br /&gt;
&lt;br /&gt;
Analytica also comes with the default Classic theme saved as an [[Anastyles|Anastyle]] file. You can use this file to revert any model to the Classic Theme without importing the '''Color Themes Library''' using the following steps:&lt;br /&gt;
&lt;br /&gt;
# Go to '''File''' &amp;gt; '''Add Library…'''&lt;br /&gt;
# This should open the '''Select Library File''' window. By default this should be open in the '''Libraries''' folder. If not, this '''Libraries''' folder is usually accessible by going to C:/Program Files/Lumina/Analytica/Libraries. &lt;br /&gt;
# Open the '''Node Styles''' folder.&lt;br /&gt;
# Select the '''Defaults.anastyle''' file and press '''Open'''.&lt;br /&gt;
&lt;br /&gt;
== Release Notes ==&lt;br /&gt;
The latest Color Themes Library was released July 6, 2023. Updates include:&lt;br /&gt;
&lt;br /&gt;
* Fixed Export Anastyle bug when Classic theme is selected&lt;br /&gt;
* Ability to change example node styles and apply them as default styles&lt;br /&gt;
* Arrow Settings and Corner Settings added in Additional Settings module&lt;br /&gt;
* Export Anastyle button now exports the current default settings to accommodate any customization made&lt;br /&gt;
* Library variable identifiers have now been prefixed to avoid name conflicts when importing into models&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61051</id>
		<title>Color Themes Library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61051"/>
		<updated>2024-06-25T18:47:15Z</updated>

		<summary type="html">&lt;p&gt;Max: Enlarged initial diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use the '''Color Themes Library''' to quickly update your diagram and graph styles with some new and updated preset themes! Simply add the '''Color Themes Library''' into your model to update your model’s theme.&lt;br /&gt;
&lt;br /&gt;
When you open the '''Color Themes Library''', you’ll see the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:Colorthemeslibrary.jpg|alt=|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
The '''Color Themes Library''' shows examples of each node class, including text, picture, form, and slider defaults as well as an Example Diagram to show how the selected theme looks. To the right of the example nodes there is a button '''Apply example node styles as default style'''. Under these examples there is a '''Select Diagram Theme''' menu which allows you to select theme and other options, and to the right of that menu there is an '''Additional Settings''' module and two buttons, '''Set all nodes to default color and border styles''' and '''Export Anastyle'''. At the bottom of the window is the '''Graph Examples''' menu which allows you to select graph themes and see examples of the selected settings on various graph types. &lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
You can download the Color Themes Library here: [[Media:Color Themes Library.ana|Color Themes Library.ana]]. To use it, simply add the library into your model. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Nodes and graphs that already have non-default options selected will not update when defaults are changed. If you have nodes with explicit color and style settings that you would like to revert to model defaults, use the '''Set all nodes to default color and border styles''' button at the bottom right of the library.&lt;br /&gt;
* Arrow border colors will only change in Analytica versions 6.3.0 or newer&lt;br /&gt;
* [[Slider|Slider bars]] (and styles) will only display in Analytica versions 6.3.0 or newer&lt;br /&gt;
* Bar graph outlines will only change in Analytica versions 5.0.7 or newer&lt;br /&gt;
&lt;br /&gt;
== Apple example node styles as default style ==&lt;br /&gt;
[[File:Colorthemeslibrary examplenodes.png|892x892px]]&lt;br /&gt;
&lt;br /&gt;
At the top of the library are example nodes. While in Edit Mode you can change the styles of these nodes directly using the Node Style menu and Color Palette. The '''Apply example node styles as default style''' button will set the styles of these example nodes as the model default style. This will apply these styles to all nodes in the model using the default model style and allow you to export these styles as an Anastyle using the '''Export Anastyle''' button at the bottom of the library window. &lt;br /&gt;
&lt;br /&gt;
Note that the font styles of these nodes will '''not''' be applied to the default style.&lt;br /&gt;
&lt;br /&gt;
Any changes made to these nodes and the default style will be reset when Diagram colors are changed in the '''Select Diagram Theme''' menu below.&lt;br /&gt;
&lt;br /&gt;
== Select Diagram Theme Menu ==&lt;br /&gt;
[[File:Selectdiagramtheme.png|alt=|frameless]]&lt;br /&gt;
&lt;br /&gt;
Use the '''Select Diagram Theme''' menu to update your model’s default theme options. This menu includes the following options:&lt;br /&gt;
&lt;br /&gt;
* Diagram colors&lt;br /&gt;
* Node borders&lt;br /&gt;
* Font size&lt;br /&gt;
* Font&lt;br /&gt;
&lt;br /&gt;
==== Diagram colors ====&lt;br /&gt;
The '''Diagram colors''' drop-down select menu allows you to select one of our preset themes. Changing this menu automatically updates model defaults to the selected theme. &lt;br /&gt;
&lt;br /&gt;
The available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Diagram Color Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:2023darktheme.png|alt=2023 Dark Colors Theme|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Classictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Monochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Viridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Plasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
See the [https://lumina.com/behind-the-scenes-5-3-color-themes/ Lumina Blog] for insight on how the Viridis and Plasma themes were designed.&lt;br /&gt;
&lt;br /&gt;
==== Node borders ====&lt;br /&gt;
Use the '''Node borders''' option to select node border style.  &lt;br /&gt;
&lt;br /&gt;
Select ''None'' to turn off node borders. Selecting this option will also toggle borders on and off in graphs. ''Monochrome'' sets a single border color for all nodes and ''Color'' sets custom border colors depending on each nodes’ color. See the table below for examples of the options:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Examples of nodes with different Node borders options&lt;br /&gt;
!None&lt;br /&gt;
!Monochrome&lt;br /&gt;
!Color&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Examplediagramnoborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithstandardborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithnodecolorborders.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
Some themes will automatically update the Include borders option to the selected theme’s  default when you change themes, but this option can still be changed according to your tastes. &lt;br /&gt;
&lt;br /&gt;
==== Font Size ====&lt;br /&gt;
The '''Font size''' menu allows you to change the font size of your model. This will affect the text and tables in diagrams, graphs, Object View, and Result View.&lt;br /&gt;
&lt;br /&gt;
==== Font  ====&lt;br /&gt;
The '''Font''' menu allows you to change the font of your model. This will affect the text in diagrams and graphs.&lt;br /&gt;
&lt;br /&gt;
== Graph Examples Menu ==&lt;br /&gt;
[[File:Graphexamplesmenu.png|frameless|512x512px]]&lt;br /&gt;
&lt;br /&gt;
The '''Graph Examples''' menu allows you to change your graph theme and view various example graphs. By default, the S'''ame diagram and graph themes''' option is selected and graphs will match the selected '''Diagram colors'''. &lt;br /&gt;
&lt;br /&gt;
If you uncheck the '''Same diagram and graph themes''' option, several menus will appear on the right hand side of the menu. The '''Graph theme''' drop-down menu provides a list of graph theme options for you to choose from. The '''Graph font size''' drop-down menu will change the font size in graphs. And the '''Include graph borders''' checkbox allows you to toggle borders on and off in graphs. Changing these selections will update the graph settings accordingly. &lt;br /&gt;
&lt;br /&gt;
Click the Result icon ([[File:VirtButtonBareIcon6.0.png]]) for each graph type to see an example.&lt;br /&gt;
&lt;br /&gt;
Examples of the available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Graph Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:Graphin2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:Graphin2023darktheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!2023 Rainbow&lt;br /&gt;
[[File:Graphin2023rainbowtheme.png|frameless]]&lt;br /&gt;
!2023 Dark Rainbow&lt;br /&gt;
[[File:Graphin2023darkrainbowgraphtheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Graphinclassictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Graphinmonochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Graphinviridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Graphinplasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set all nodes to default color and border styles ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is a '''Set all nodes to default color and border styles''' button. Nodes with explicit colors and styles will not update when model defaults are changed. This button reset all nodes with explicit colors and styles so they will use the defaults, ''i.e.'', the colors from the selected theme, again. &lt;br /&gt;
&lt;br /&gt;
== Export Anastyle ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is an '''Export Anastyle''' button. Clicking on this button will save the current model's default diagram and graph theme options into an [[Anastyles|Anastyle]] file that can be imported into other models. This way you can easily import your selected options into other models without having to import the '''Color Themes Library''' and select your options again. You can import an Anastyle file to a model the same way you would add a Library into a model.&lt;br /&gt;
&lt;br /&gt;
See [[Anastyles]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Additional Settings ==&lt;br /&gt;
[[File:Colorthemeslibrary additionalsettings.png|617x617px]]&lt;br /&gt;
&lt;br /&gt;
The '''Additional Settings''' module is located on the right hand side of the library under the example nodes. Open this module to access Arrow Settings and Corner Settings. &lt;br /&gt;
&lt;br /&gt;
=== Arrow Settings ===&lt;br /&gt;
The Arrow settings menu allows you to change the default size and color of arrows. &lt;br /&gt;
&lt;br /&gt;
Use the '''Arrow size''' drop-down select menu to change the arrow size.&lt;br /&gt;
&lt;br /&gt;
Change the arrow color by changing the color of the '''Arrow color''' node, then pressing the '''Apply color''' button beneath it. Your selected color will not be applied as the default color until you press the '''Apply color''' button. Note that you must be in Edit mode to change the Arrow color node. If you are in Edit mode, you can open the Color Palette by right-clicking on the Arrow color node and selecting Show/Hide Color Palette.&lt;br /&gt;
&lt;br /&gt;
=== Corner Settings ===&lt;br /&gt;
The Corner Settings menu allows you to change the default corner radius of certain objects. &lt;br /&gt;
&lt;br /&gt;
Use the '''Set corner radius to''' drop-down select menu to select a corner radius. The Null option selects the system default corner radius. &lt;br /&gt;
&lt;br /&gt;
Use the '''For object types''' multi-choice select menu to select which objects the corner radius settings should apply to. Options include Text nodes, Frame nodes, User inputs and outputs, and Buttons.&lt;br /&gt;
&lt;br /&gt;
== Reverting to the Classic Theme ==&lt;br /&gt;
If you’re using the '''Color Themes Library''' and would like to go back to the Classic Analytica theme, you can simply select the Classic diagram colors and graph theme options.&lt;br /&gt;
&lt;br /&gt;
Analytica also comes with the default Classic theme saved as an [[Anastyles|Anastyle]] file. You can use this file to revert any model to the Classic Theme without importing the '''Color Themes Library''' using the following steps:&lt;br /&gt;
&lt;br /&gt;
# Go to '''File''' &amp;gt; '''Add Library…'''&lt;br /&gt;
# This should open the '''Select Library File''' window. By default this should be open in the '''Libraries''' folder. If not, this '''Libraries''' folder is usually accessible by going to C:/Program Files/Lumina/Analytica/Libraries. &lt;br /&gt;
# Open the '''Node Styles''' folder.&lt;br /&gt;
# Select the '''Defaults.anastyle''' file and press '''Open'''.&lt;br /&gt;
&lt;br /&gt;
== Release Notes ==&lt;br /&gt;
The latest Color Themes Library was released July 6, 2023. Updates include:&lt;br /&gt;
&lt;br /&gt;
* Fixed Export Anastyle bug when Classic theme is selected&lt;br /&gt;
* Ability to change example node styles and apply them as default styles&lt;br /&gt;
* Arrow Settings and Corner Settings added in Additional Settings module&lt;br /&gt;
* Export Anastyle button now exports the current default settings to accommodate any customization made&lt;br /&gt;
* Library variable identifiers have now been prefixed to avoid name conflicts when importing into models&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61050</id>
		<title>Color Themes Library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Color_Themes_Library&amp;diff=61050"/>
		<updated>2024-06-25T18:46:53Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use the '''Color Themes Library''' to quickly update your diagram and graph styles with some new and updated preset themes! Simply add the '''Color Themes Library''' into your model to update your model’s theme.&lt;br /&gt;
&lt;br /&gt;
When you open the '''Color Themes Library''', you’ll see the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:Colorthemeslibrary.jpg|alt=|frameless|500x500px]]&lt;br /&gt;
&lt;br /&gt;
The '''Color Themes Library''' shows examples of each node class, including text, picture, form, and slider defaults as well as an Example Diagram to show how the selected theme looks. To the right of the example nodes there is a button '''Apply example node styles as default style'''. Under these examples there is a '''Select Diagram Theme''' menu which allows you to select theme and other options, and to the right of that menu there is an '''Additional Settings''' module and two buttons, '''Set all nodes to default color and border styles''' and '''Export Anastyle'''. At the bottom of the window is the '''Graph Examples''' menu which allows you to select graph themes and see examples of the selected settings on various graph types. &lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
You can download the Color Themes Library here: [[Media:Color Themes Library.ana|Color Themes Library.ana]]. To use it, simply add the library into your model. &lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Nodes and graphs that already have non-default options selected will not update when defaults are changed. If you have nodes with explicit color and style settings that you would like to revert to model defaults, use the '''Set all nodes to default color and border styles''' button at the bottom right of the library.&lt;br /&gt;
* Arrow border colors will only change in Analytica versions 6.3.0 or newer&lt;br /&gt;
* [[Slider|Slider bars]] (and styles) will only display in Analytica versions 6.3.0 or newer&lt;br /&gt;
* Bar graph outlines will only change in Analytica versions 5.0.7 or newer&lt;br /&gt;
&lt;br /&gt;
== Apple example node styles as default style ==&lt;br /&gt;
[[File:Colorthemeslibrary examplenodes.png|892x892px]]&lt;br /&gt;
&lt;br /&gt;
At the top of the library are example nodes. While in Edit Mode you can change the styles of these nodes directly using the Node Style menu and Color Palette. The '''Apply example node styles as default style''' button will set the styles of these example nodes as the model default style. This will apply these styles to all nodes in the model using the default model style and allow you to export these styles as an Anastyle using the '''Export Anastyle''' button at the bottom of the library window. &lt;br /&gt;
&lt;br /&gt;
Note that the font styles of these nodes will '''not''' be applied to the default style.&lt;br /&gt;
&lt;br /&gt;
Any changes made to these nodes and the default style will be reset when Diagram colors are changed in the '''Select Diagram Theme''' menu below.&lt;br /&gt;
&lt;br /&gt;
== Select Diagram Theme Menu ==&lt;br /&gt;
[[File:Selectdiagramtheme.png|alt=|frameless]]&lt;br /&gt;
&lt;br /&gt;
Use the '''Select Diagram Theme''' menu to update your model’s default theme options. This menu includes the following options:&lt;br /&gt;
&lt;br /&gt;
* Diagram colors&lt;br /&gt;
* Node borders&lt;br /&gt;
* Font size&lt;br /&gt;
* Font&lt;br /&gt;
&lt;br /&gt;
==== Diagram colors ====&lt;br /&gt;
The '''Diagram colors''' drop-down select menu allows you to select one of our preset themes. Changing this menu automatically updates model defaults to the selected theme. &lt;br /&gt;
&lt;br /&gt;
The available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Diagram Color Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:2023darktheme.png|alt=2023 Dark Colors Theme|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Classictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Monochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Viridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Plasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
See the [https://lumina.com/behind-the-scenes-5-3-color-themes/ Lumina Blog] for insight on how the Viridis and Plasma themes were designed.&lt;br /&gt;
&lt;br /&gt;
==== Node borders ====&lt;br /&gt;
Use the '''Node borders''' option to select node border style.  &lt;br /&gt;
&lt;br /&gt;
Select ''None'' to turn off node borders. Selecting this option will also toggle borders on and off in graphs. ''Monochrome'' sets a single border color for all nodes and ''Color'' sets custom border colors depending on each nodes’ color. See the table below for examples of the options:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Examples of nodes with different Node borders options&lt;br /&gt;
!None&lt;br /&gt;
!Monochrome&lt;br /&gt;
!Color&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Examplediagramnoborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithstandardborders.png|frameless]]&lt;br /&gt;
|[[File:Examplediagramwithnodecolorborders.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
Some themes will automatically update the Include borders option to the selected theme’s  default when you change themes, but this option can still be changed according to your tastes. &lt;br /&gt;
&lt;br /&gt;
==== Font Size ====&lt;br /&gt;
The '''Font size''' menu allows you to change the font size of your model. This will affect the text and tables in diagrams, graphs, Object View, and Result View.&lt;br /&gt;
&lt;br /&gt;
==== Font  ====&lt;br /&gt;
The '''Font''' menu allows you to change the font of your model. This will affect the text in diagrams and graphs.&lt;br /&gt;
&lt;br /&gt;
== Graph Examples Menu ==&lt;br /&gt;
[[File:Graphexamplesmenu.png|frameless|512x512px]]&lt;br /&gt;
&lt;br /&gt;
The '''Graph Examples''' menu allows you to change your graph theme and view various example graphs. By default, the S'''ame diagram and graph themes''' option is selected and graphs will match the selected '''Diagram colors'''. &lt;br /&gt;
&lt;br /&gt;
If you uncheck the '''Same diagram and graph themes''' option, several menus will appear on the right hand side of the menu. The '''Graph theme''' drop-down menu provides a list of graph theme options for you to choose from. The '''Graph font size''' drop-down menu will change the font size in graphs. And the '''Include graph borders''' checkbox allows you to toggle borders on and off in graphs. Changing these selections will update the graph settings accordingly. &lt;br /&gt;
&lt;br /&gt;
Click the Result icon ([[File:VirtButtonBareIcon6.0.png]]) for each graph type to see an example.&lt;br /&gt;
&lt;br /&gt;
Examples of the available themes are shown in the table below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Graph Themes available in Color Themes Library&lt;br /&gt;
!2023&lt;br /&gt;
[[File:Graphin2023theme.png|frameless]]&lt;br /&gt;
!2023 Dark&lt;br /&gt;
[[File:Graphin2023darktheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!2023 Rainbow&lt;br /&gt;
[[File:Graphin2023rainbowtheme.png|frameless]]&lt;br /&gt;
!2023 Dark Rainbow&lt;br /&gt;
[[File:Graphin2023darkrainbowgraphtheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Classic&lt;br /&gt;
[[File:Graphinclassictheme.png|frameless]]&lt;br /&gt;
!Monochrome&lt;br /&gt;
[[File:Graphinmonochrometheme.png|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
!Viridis&lt;br /&gt;
[[File:Graphinviridistheme.png|frameless]]&lt;br /&gt;
!Plasma&lt;br /&gt;
[[File:Graphinplasmatheme.png|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set all nodes to default color and border styles ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is a '''Set all nodes to default color and border styles''' button. Nodes with explicit colors and styles will not update when model defaults are changed. This button reset all nodes with explicit colors and styles so they will use the defaults, ''i.e.'', the colors from the selected theme, again. &lt;br /&gt;
&lt;br /&gt;
== Export Anastyle ==&lt;br /&gt;
At the bottom right of the '''Color Themes Library''' is an '''Export Anastyle''' button. Clicking on this button will save the current model's default diagram and graph theme options into an [[Anastyles|Anastyle]] file that can be imported into other models. This way you can easily import your selected options into other models without having to import the '''Color Themes Library''' and select your options again. You can import an Anastyle file to a model the same way you would add a Library into a model.&lt;br /&gt;
&lt;br /&gt;
See [[Anastyles]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Additional Settings ==&lt;br /&gt;
[[File:Colorthemeslibrary additionalsettings.png|617x617px]]&lt;br /&gt;
&lt;br /&gt;
The '''Additional Settings''' module is located on the right hand side of the library under the example nodes. Open this module to access Arrow Settings and Corner Settings. &lt;br /&gt;
&lt;br /&gt;
=== Arrow Settings ===&lt;br /&gt;
The Arrow settings menu allows you to change the default size and color of arrows. &lt;br /&gt;
&lt;br /&gt;
Use the '''Arrow size''' drop-down select menu to change the arrow size.&lt;br /&gt;
&lt;br /&gt;
Change the arrow color by changing the color of the '''Arrow color''' node, then pressing the '''Apply color''' button beneath it. Your selected color will not be applied as the default color until you press the '''Apply color''' button. Note that you must be in Edit mode to change the Arrow color node. If you are in Edit mode, you can open the Color Palette by right-clicking on the Arrow color node and selecting Show/Hide Color Palette.&lt;br /&gt;
&lt;br /&gt;
=== Corner Settings ===&lt;br /&gt;
The Corner Settings menu allows you to change the default corner radius of certain objects. &lt;br /&gt;
&lt;br /&gt;
Use the '''Set corner radius to''' drop-down select menu to select a corner radius. The Null option selects the system default corner radius. &lt;br /&gt;
&lt;br /&gt;
Use the '''For object types''' multi-choice select menu to select which objects the corner radius settings should apply to. Options include Text nodes, Frame nodes, User inputs and outputs, and Buttons.&lt;br /&gt;
&lt;br /&gt;
== Reverting to the Classic Theme ==&lt;br /&gt;
If you’re using the '''Color Themes Library''' and would like to go back to the Classic Analytica theme, you can simply select the Classic diagram colors and graph theme options.&lt;br /&gt;
&lt;br /&gt;
Analytica also comes with the default Classic theme saved as an [[Anastyles|Anastyle]] file. You can use this file to revert any model to the Classic Theme without importing the '''Color Themes Library''' using the following steps:&lt;br /&gt;
&lt;br /&gt;
# Go to '''File''' &amp;gt; '''Add Library…'''&lt;br /&gt;
# This should open the '''Select Library File''' window. By default this should be open in the '''Libraries''' folder. If not, this '''Libraries''' folder is usually accessible by going to C:/Program Files/Lumina/Analytica/Libraries. &lt;br /&gt;
# Open the '''Node Styles''' folder.&lt;br /&gt;
# Select the '''Defaults.anastyle''' file and press '''Open'''.&lt;br /&gt;
&lt;br /&gt;
== Release Notes ==&lt;br /&gt;
The latest Color Themes Library was released July 6, 2023. Updates include:&lt;br /&gt;
&lt;br /&gt;
* Fixed Export Anastyle bug when Classic theme is selected&lt;br /&gt;
* Ability to change example node styles and apply them as default styles&lt;br /&gt;
* Arrow Settings and Corner Settings added in Additional Settings module&lt;br /&gt;
* Export Anastyle button now exports the current default settings to accommodate any customization made&lt;br /&gt;
* Library variable identifiers have now been prefixed to avoid name conflicts when importing into models&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Items_within_Budget_function&amp;diff=61043</id>
		<title>Items within Budget function</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Items_within_Budget_function&amp;diff=61043"/>
		<updated>2024-06-20T00:52:18Z</updated>

		<summary type="html">&lt;p&gt;Max: /* Example model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Examples]]&lt;br /&gt;
=== Example model ===&lt;br /&gt;
&lt;br /&gt;
'''Description:''' Given a set of items, each with a cost and priority, the function Items_within_budget &lt;br /&gt;
returns a vector with 1 or 0 to identify the items selected, with the highest priority items whose cumulative cost is within the specified budget.&lt;br /&gt;
&lt;br /&gt;
'''Keywords:'''&lt;br /&gt;
&lt;br /&gt;
'''Author:''' Max Henrion&lt;br /&gt;
&lt;br /&gt;
'''Download''': [[Media:Items_within_budget.ana|Items within budget.ana]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60934</id>
		<title>Weibull estimation library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60934"/>
		<updated>2024-05-29T02:35:54Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Weibull distribution]]s are widely used for modeling lifetimes of automobiles, engines, and other equipment. Also for the lifetimes of people. This library includes functions for estimating Weibull distributions for lifespan or time to failure from data, and to obtain mean, median, and variance, and percentiles of a Weibull from its shape (k) and scale (lamda) parameters (and vice versa).&lt;br /&gt;
&lt;br /&gt;
[[File:Weibull estimation lib.png|600px]]&lt;br /&gt;
&lt;br /&gt;
'''Weibull_Estimate(age, i)''' estimates the Weibull parameters from lifespan (age at death) when all population has failed (died).&lt;br /&gt;
&lt;br /&gt;
'''Weibull_est_RC(age, died, i)''' estimates Weibull parameters from lifespan (age at death) or age using &amp;quot;right-censored&amp;quot; (RC) data -- i.e. when some individuals have survived. This function requires the Analytica Optimizer. The other functions will work fine with lesser editions of Analytica&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [[media:Weibull estimation lib.ana]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Weibull distribution]]&lt;br /&gt;
* [[Weibull_10_50_90]]&lt;br /&gt;
* [[Probability distributions]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60933</id>
		<title>Weibull estimation library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60933"/>
		<updated>2024-05-29T02:33:37Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Weibull distributions are widely used for modeling lifetimes of automobiles, engines, and other equipment. Also for the lifetimes of people. This library includes functions for estimating Weibull distributions for lifespan or time to failure from data, and to obtain mean, median, and variance, and percentiles of a Weibull from its shape (k) and scale (lamda) parameters (and vice versa).&lt;br /&gt;
&lt;br /&gt;
[[File:Weibull estimation lib.png|600px]]&lt;br /&gt;
&lt;br /&gt;
'''Weibull_Estimate(age, i)''' estimates the Weibull parameters from lifespan (age at death) when all population has failed (died).&lt;br /&gt;
&lt;br /&gt;
'''Weibull_est_RC(age, died, i)''' estimates Weibull parameters from lifespan (age at death) or age using &amp;quot;right-censored&amp;quot; (RC) data -- i.e. when some individuals have survived. This function requires the Analytica Optimizer. The other functions will work fine with lesser editions of Analytica&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [[media:Weibull estimation lib.ana]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Weibull estimation library]]&lt;br /&gt;
* [[Rayleigh]]&lt;br /&gt;
* [[Weibull_10_50_90]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60932</id>
		<title>Weibull estimation library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60932"/>
		<updated>2024-05-29T02:33:16Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Weibull distributions are widely used for modeling lifetimes of automobiles, engines, and other equipment. Also for the lifetimes of people. This library includes functions for estimating Weibull distributions for lifespan or time to failure from data, and to obtain mean, median, and variance, and percentiles of a Weibull from its shape (k) and scale (lamda) parameters (and vice versa).&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[File:Weibull estimation lib.png|600px]]&lt;br /&gt;
&lt;br /&gt;
'''Weibull_Estimate(age, i)''' estimates the Weibull parameters from lifespan (age at death) when all population has failed (died).&lt;br /&gt;
&lt;br /&gt;
'''Weibull_est_RC(age, died, i)''' estimates Weibull parameters from lifespan (age at death) or age using &amp;quot;right-censored&amp;quot; (RC) data -- i.e. when some individuals have survived. This function requires the Analytica Optimizer. The other functions will work fine with lesser editions of Analytica&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [[media:Weibull estimation lib.ana]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Weibull estimation library]]&lt;br /&gt;
* [[Rayleigh]]&lt;br /&gt;
* [[Weibull_10_50_90]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60931</id>
		<title>Weibull estimation library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60931"/>
		<updated>2024-05-29T02:30:35Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Weibull distributions are widely used for modeling lifetimes of automobiles, engines, and other equipment. Also for the lifetimes of people. This library includes functions for estimating Weibull distributions for lifespan or time to failure from data, and to obtain mean, median, and variance, and percentiles of a Weibull from its shape (k) and scale (lamda) parameters (and vice versa).&lt;br /&gt;
&lt;br /&gt;
'''Download:''' [[File:Weibull estimation library.png|600px]]&lt;br /&gt;
&lt;br /&gt;
''Weibull_Estimate(age, i)'' estimates the Weibull parameters from lifespan (age at death) when all population has failed (died).&lt;br /&gt;
&lt;br /&gt;
''Weibull_est_RC(age, died, i)'' estimates Weibull parameters from lifespan (age at death) or age using &amp;quot;right-censored&amp;quot; (RC) data -- i.e. when some individuals have survived. This function requires the Analytica Optimizer. The other functions will work fine with lesser editions of Analytica&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [[media:Weibull estimation lib.ana]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Weibull estimation library]]&lt;br /&gt;
* [[Rayleigh]]&lt;br /&gt;
* [[Weibull_10_50_90]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=File:Weibull_estimation_lib.ana&amp;diff=60930</id>
		<title>File:Weibull estimation lib.ana</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=File:Weibull_estimation_lib.ana&amp;diff=60930"/>
		<updated>2024-05-29T02:27:26Z</updated>

		<summary type="html">&lt;p&gt;Max: Analytica library for estimating Weibull distributions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Analytica library for estimating Weibull distributions&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60929</id>
		<title>Weibull estimation library</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Weibull_estimation_library&amp;diff=60929"/>
		<updated>2024-05-29T02:25:46Z</updated>

		<summary type="html">&lt;p&gt;Max: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Weibull distributions are widely used for modeling lifetimes of automobiles, engines, and other equipment. Also for the lifetimes of people. This library includes functions for estimating Weibull distributions for lifespan or time to failure from data, and to obtain mean, median, and variance, and percentiles of a Weibull from its shape (k) and scale (lamda) parameters (and vice versa).&lt;br /&gt;
&lt;br /&gt;
[[File:Weibull estimation library.png|600px]]&lt;br /&gt;
&lt;br /&gt;
''Weibull_Estimate(age, i)'' estimates the Weibull parameters from lifespan (age at death) when all population has failed (died).&lt;br /&gt;
&lt;br /&gt;
''Weibull_est_RC(age, died, i)'' estimates Weibull parameters from lifespan (age at death) or age using &amp;quot;right-censored&amp;quot; (RC) data -- i.e. when some individuals have survived. This function requires the Analytica Optimizer. The other functions will work fine with lesser editions of Analytica&lt;br /&gt;
&lt;br /&gt;
'''Download: ''' [[media: Weibull estimation lib.ANA]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Weibull estimation library]]&lt;br /&gt;
* [[Rayleigh]]&lt;br /&gt;
* [[Weibull_10_50_90]]&lt;/div&gt;</summary>
		<author><name>Max</name></author>
	</entry>
</feed>