Articles


Leo Tree Model - dedenting node

In the previous post, methods clone_node and indent_node were described. Next method we are going to describe is dedent_node or moving node left.

Method dedent_node

Method dedent_node(pos) moves node at the given position to left, i.e. to its grand-parent just after its current parent. This operation can change …

➟ Read more

Leo Tree Model - cloning and indenting node

In the previous post, I have explained how delete_node works. Now, I am going to explain clone_node command. First let’s see picture of this operation.

A snapshot of tree model data before and after executing clone_node(P5)
A snapshot of tree model data before and after executing clone_node(P5)

Please note: we are continuing to modify outline from the previous post …

➟ Read more

Leo Tree Model - tree operations

In the previous post, I have explained two basic helper classes LTMData and NData and gave you an example of a picture showing content of Leo model data for one example outline. In this part, I will use more pictures like that one. If you don’t understand what the …

➟ Read more

Leo Tree Model - rewritten

The new Leo tree data model has been evolving during last few weeks. Some things has been changed since my last post. I guess now may be the right time to explain how it works and why it was designed the way it is.

But before I start to explain …

➟ Read more

Leo Tree Model - adding outline commands

In the previous part I wrote about functions for loading LeoTreeModel from xml files as well as loading external files. Now, that we have loaded outline let’s add some functions for moving nodes around.

Selecting nodes

User will need to select node previous, next, left, right. LeoTreeModel has field …

➟ Read more

Leo Tree Model - loading from a file

In the previous part I wrote about implementation of LeoTreeModel class and its fields. First instances of LeoTreeModel were made from Leo’s VNode instances. Now let’s enable building LeoTreeModel directly from .leo xml files.

Loading from Leo xml file

We already have function that builds LeoTreeModel based on …

➟ Read more

Leo Tree Model - new approach

What would Leo’s data model look like if I were to build it now? Leo has a long history and its current data model is the result of the evolution process. Many different ideas were combined and applied, and some of them were later abandoned. All these ideas left …

➟ Read more

FP prototyping -- conclusion

After little bit of polishing and cleaning, prototype code:

  • has 238 lines of code,
  • imports rpg_objects.js file on average in about 250ms
  • it is perfect import (writing file gives the same content as original)
  • imported outline is in optimal shape
  • prototype has been written and polished in less than …
➟ Read more

Functional programming for prototyping II

This is the second part of story about using functional programming for prototyping (first part is Here). Originally, my intention was to document whole process of prototyping. I wished not to finish prototype and then describe it after, but to show every step in my work-flow. However, soon after I …

➟ Read more