Skip to content

Instantly share code, notes, and snippets.


Ingo Dahn ingodahn

  • Koblenz, Germany
View GitHub Profile
ingodahn /
Last active February 24, 2023 18:25
A vue component with a SageCell

SageCell.vue is a Vue 2 component that dynamically creates a SageCell. It akes the following properties as input.

  • script: A string that is inserted into the input of the generated SageCell.
  • cellName: A name attribute vor the div containing the SageCell
  • kernelKey: A name for the SageMath computational environment. Components using the same kernelKey shall run in the same computational environmen. Their SageCells shall be linked.
  • options: An options object as defined in the SageCell documentation

When the SageCell input field is edited or when the cell is evaluated, the component sends a respective signal to its parent component. The current content of the SageCell input can be retrieved by calling the method getCurrentScript of the component.