<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.impvis.co.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rishavc7</id>
	<title>ImpVis Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.impvis.co.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rishavc7"/>
	<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Special:Contributions/Rishavc7"/>
	<updated>2026-04-13T06:01:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.0</generator>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1391</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1391"/>
		<updated>2022-07-12T09:52:21Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
Code to implement the Pane seen on the right.&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1372</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1372"/>
		<updated>2022-07-07T11:04:04Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
Code to implement the Pane seen on the right.&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;pre&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1371</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1371"/>
		<updated>2022-07-07T11:01:56Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;pre&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1370</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1370"/>
		<updated>2022-07-07T10:58:41Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1369</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1369"/>
		<updated>2022-07-07T10:54:35Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;pre&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1368</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1368"/>
		<updated>2022-07-07T10:54:07Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
&lt;br /&gt;
	less = []&lt;br /&gt;
&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
&lt;br /&gt;
	more = []&lt;br /&gt;
&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
&lt;br /&gt;
		return arr&lt;br /&gt;
&lt;br /&gt;
	else:&lt;br /&gt;
&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1367</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1367"/>
		<updated>2022-07-07T10:53:01Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
&lt;br /&gt;
	less = []&lt;br /&gt;
&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
&lt;br /&gt;
	more = []&lt;br /&gt;
&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
&lt;br /&gt;
		return arr&lt;br /&gt;
&lt;br /&gt;
	else:&lt;br /&gt;
&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1366</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1366"/>
		<updated>2022-07-07T10:52:41Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
&lt;br /&gt;
	less = []&lt;br /&gt;
&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
&lt;br /&gt;
	more = []&lt;br /&gt;
&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
&lt;br /&gt;
		return arr&lt;br /&gt;
&lt;br /&gt;
	else:&lt;br /&gt;
&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1365</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1365"/>
		<updated>2022-07-07T10:51:24Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
&lt;br /&gt;
	less = []&lt;br /&gt;
&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
&lt;br /&gt;
	more = []&lt;br /&gt;
&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
&lt;br /&gt;
		return arr&lt;br /&gt;
&lt;br /&gt;
	else:&lt;br /&gt;
&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1364</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1364"/>
		<updated>2022-07-07T10:50:37Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):\n&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1363</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1363"/>
		<updated>2022-07-07T10:50:19Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1362</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1362"/>
		<updated>2022-07-07T10:43:43Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left-hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; style=&amp;quot;border: 3px dashed blue;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1361</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1361"/>
		<updated>2022-07-07T10:43:08Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Panes */  - Syntax highlighting demo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
‎&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; style=&amp;quot;border: 3px dashed blue;&amp;quot;&amp;gt;&lt;br /&gt;
def quick_sort(arr):&lt;br /&gt;
	less = []&lt;br /&gt;
	pivot_list = []&lt;br /&gt;
	more = []&lt;br /&gt;
	if len(arr) &amp;lt;= 1:&lt;br /&gt;
		return arr&lt;br /&gt;
	else:&lt;br /&gt;
		pass&lt;br /&gt;
‎&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1348</id>
		<title>Basic Component Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Basic_Component_Tutorial&amp;diff=1348"/>
		<updated>2022-06-23T15:10:42Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* Toggleable hotspots */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains basic information on how to set up the Pane and Hotspot components in your visualisation code. For information on how to edit the components, see [[Editing ImpVis Components]]. The page assumes you have set up a new visualisation, as described [[Tutorial for setting up the coding environment#Creating a new visualisation|here]]. &lt;br /&gt;
[[File:Pane screenshot.png|thumb|Screenshot of the pane being implemented.]]&lt;br /&gt;
&lt;br /&gt;
== Panes ==&lt;br /&gt;
&lt;br /&gt;
[[Pane|Panes]] are clickable and draggable environments to place text and images over a visualisation. The code seen below is what's needed to produce the pane seen to the right of this text; this can also be seen on the left hand side of [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_27.html Pane tutorial page]. &lt;br /&gt;
[[File:Pane code.06188d60.png|center|thumb|518x518px|Code to implement the Pane seen on the right.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding content to the mainstage ==&lt;br /&gt;
[[File:Shm code.3432acb7.png|left|thumb|SHM code being implemented in MainStage.vue]]&lt;br /&gt;
&lt;br /&gt;
This example implements a simple harmonic motion (SHM) graphic on the mainstage. Firstly, if you want to copy and paste this code, check out the SHM folder contained in the GitHub repository for this tutorial document at https://github.com/Imperial-visualizations/Tutorial. This document is intended to be useful seeing the logic of setting up such a visualisation, as opposed to providing the code to be changed. But please do spend some time messing around with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code to produce an object which performs SHM is pasted to the left of this text. This should sit in the MainStage.vue file, as we want to treat the SHM block as a component, which we can use multiple times anywhere. Specifically, the code makes a basic SHM vis using a prop for any variables I may want to control with sliders/buttons. When you run this code, you should see a ball conducting SHM on the screen.&lt;br /&gt;
&lt;br /&gt;
Sliders which control the SHM motion can be be added, to see this in action, check out the App.vue file in the SHM vis, from there, you will be able to see how interaction with the MainStage component is brought about.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Toggleable hotspots ==&lt;br /&gt;
[[File:Toggleable hotspot screenshot.png|thumb|600x600px|Screenshot of the implementation of the toggleable hotspot.]]&lt;br /&gt;
&lt;br /&gt;
Hotspots overlay onto the page similarly to a Pane, but are smaller, and can be stuck on the corners or edges of a page. They can be used to house text or tools used to interact with a visualisation. The code pasted here demonstrates how to produce a ''toggleable'' hotspot, which is a hotspot that can be toggled in and out of the way of the visualisation.&lt;br /&gt;
[[File:Toggleable hotspot code.png|thumb|600x600px|Code written to produce the toggleable hotspot and Pane.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interactive version of the toggleable hotspot is found on the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_28.html toggle hotspot] page of the ImpVis tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fixed hotspots ==&lt;br /&gt;
Hotspots can also be fixed in position so that they ''always'' appear onscreen, as opposed to being toggleable where they can be brought on and off. For example now, to add a fixed hotspot to the code on the previous page, we could write the code as seen below. &lt;br /&gt;
&lt;br /&gt;
[[File:Fixed hotspot code.b3b4f880.png|left|thumb|300x300px|Fixed hotspot code]]&lt;br /&gt;
[[File:Fixed hotspot screenshot.png|thumb|Fixed hotspot screenshot]]&lt;br /&gt;
Notice how the hotspot overlays over the main content of the visualisation. We will later discuss how to use this feature effectively when designing the learning journey for the users of your visualisations. The screenshotted code would produce a fixed hotspot in the top right of the page. For this demonstration, I have displayed the hotspot in the bottom right for clarity. See the [https://impvis.co.uk/launch/impvis-tutorial-unpublished/page_29.html tutorial page on fixed hotspots] to see this implemented online.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing your own components ==&lt;br /&gt;
Say you wanted to create your own component that does its own thing, you can import this as a separate file and use it in your visualisations. &lt;br /&gt;
[[File:Filename.png|thumb|Mainstage.vue file]]&lt;br /&gt;
In order to use the file (which we will call MainStage.vue for now), you must export it. Everything you might want to use outside of the MainStage.vue file is written in the export default code block.&lt;br /&gt;
&lt;br /&gt;
For example, we might want to create a canvas that we can display some interactive content in (check out the SHM visualisation, we'll go through some of that content here). To do this, we'd write the following pieces of code:&lt;br /&gt;
[[File:Mainstage code.png|center|thumb|Mainstage code.]]&lt;br /&gt;
[[File:Inserting mainstage to app.png|thumb|Inserting mainstage to app.vue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.) Place the input from mainstage into the correct part of template (where you want it to go) in App.vue &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Canvas box.a4967d50.png|thumb|Creating canvas box]]&lt;br /&gt;
2.) Insert the code that draws a box around the edges of the canvas drawing area on the screen (that's what we currently want to do, so we can see the canvas).&lt;br /&gt;
&lt;br /&gt;
A screenshot of the result of this code is pasted below.&lt;br /&gt;
[[File:Canvas box display.7731b0f1.png|center|thumb|600x600px|Canvas box result displayed.]]&lt;br /&gt;
[[Category:Coding Guidance]]&lt;br /&gt;
[[Category:Tips Whilst Coding]]&lt;br /&gt;
[[Category:ImpVis Template]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
	<entry>
		<id>https://wiki.impvis.co.uk/index.php?title=Programming_languages&amp;diff=1317</id>
		<title>Programming languages</title>
		<link rel="alternate" type="text/html" href="https://wiki.impvis.co.uk/index.php?title=Programming_languages&amp;diff=1317"/>
		<updated>2022-02-02T14:02:55Z</updated>

		<summary type="html">&lt;p&gt;Rishavc7: /* The tools we use to create visualisations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The tools we use to create visualisations ==&lt;br /&gt;
Hypertext Markup Language (HTML) is the backbone of any webpage, and this is the case for ImpVis. HTML is less of a language and more of a collection of blocks or ‘elements’ that define what goes on your page. HTML allows us to define everything on our page, but cannot do much else. For the most part, HTML is static and cannot perform complex equations or plotting. This is where JavaScript (JS) comes in. ImpVis visualisations use JS to perform physical/mathematical calculations, plot, and achieve interactivity. These elements can contain anything from text to a slider to a graph plot, and can be styled to your preference! From the size of your element to the text color, this styling can all be specified using another language: Cascading Style Sheet (CSS).&lt;br /&gt;
&lt;br /&gt;
Here are a few links to relevant places on how to do some basic HTML, CSS and JS -&lt;br /&gt;
*'''HTML''': https://www.codecademy.com/learn/learn-html https://scrimba.com/learn/htmlcss&lt;br /&gt;
*'''CSS''': https://www.codecademy.com/learn/learn-css&lt;br /&gt;
*'''JS''': https://www.codecademy.com/learn/introduction-to-javascript https://scrimba.com/learn/learnjavascript&lt;br /&gt;
For the HTML course, you will most likely require sections 1. ''Elements and Structure'', and 3. ''Forms''. You may choose to opt-out on learning CSS as we have a set of predefined components, like sliders and buttons, which will be introduced later! If you are interested in customising the components, you may come back and learn CSS. As for JS, sections 2-7 are essential, and sections 8 and 9 are useful for object-oriented programming.&lt;br /&gt;
&lt;br /&gt;
While coding a visualisation, you will inevitably have to use some mathematical functions. ''Math.js'' is an extensive JS math library that provides many useful tools. For more information, https://mathjs.org/.&lt;br /&gt;
&lt;br /&gt;
== Further links ==&lt;br /&gt;
Have a look at our [[Help on HTML, CSS, JS and JS libraries]] page for further guidance on these coding languages.&lt;br /&gt;
[[Category:Setting Up]]&lt;/div&gt;</summary>
		<author><name>Rishavc7</name></author>
	</entry>
</feed>