The Layout types

ScheduleJS features two and (soon three) layouts that you can use for any row of your graphics. This article describes what is a layout, how it is used, and what are the differences between these layouts.

What is a Layout?

A layout is a set…


This content originally appeared on DEV Community and was authored by Gaetan Gasoline

ScheduleJS features two and (soon three) layouts that you can use for any row of your graphics. This article describes what is a layout, how it is used, and what are the differences between these layouts.

What is a Layout?

A layout is a set of tools used to render your activities. Every layout has its specificities. For example, when you set a row layout to be the ChartLayout, you’re telling your graphics that you want to show the data in two dimensions (time and value), express every value held by an activity in proportion with the other activities’ values, and that you need to create a scale to tell the user what does the vertical dimension means in terms of value for an activity.

The requirements

To ensure their activities meet the requirements and to render their data, layouts require:

  • Their activities to extend one of the higher-order activity classes (ex: ChartActivity, MutableActivity, …)
  • The renderer to also extends a higher-order class corresponding to the layout (ex: ChartActivityRender, ActivityBarRenderer, …)

The GanttLayout

The GanttLayout is the default layout type for a row. It is also the most basic layout as it only covers a single dimension: time. To use the GanttLayout, the only attribute you have to provide to the activity is its start and end time. Alternatively, you can use a GanttLayout in combination with a custom ActivityRenderer to design a way for the user to picture the values it holds.

The GanttLayout

The ChartLayout

The ChartLayout will let you build activities into the form of a histogram. It attaches a specific value to render the activity height based on it. There are two styles of chart layout:

  • The Charts
  • The High-Low Charts

The following example shows a High-Low Chart coupled with a regular Chart. The High-Low Chart describes stocks opening and closing values and the spread, while the Chart describes daily volumes.

The HighLowChart and Chart layouts

The AgendaLayout

The AgendaLayout is used to build large rows representing daily activity vertically.

It is only present in our development branch and is not yet available in ScheduleJS 1.3. Expect it to make it soon to production.

Stay tuned for more! Here is a screenshot from our development build:

The AgendaLayout

For the final result, take a look: The Layout types


This content originally appeared on DEV Community and was authored by Gaetan Gasoline


Print Share Comment Cite Upload Translate Updates
APA

Gaetan Gasoline | Sciencx (2024-07-10T14:03:36+00:00) The Layout types. Retrieved from https://www.scien.cx/2024/07/10/the-layout-types/

MLA
" » The Layout types." Gaetan Gasoline | Sciencx - Wednesday July 10, 2024, https://www.scien.cx/2024/07/10/the-layout-types/
HARVARD
Gaetan Gasoline | Sciencx Wednesday July 10, 2024 » The Layout types., viewed ,<https://www.scien.cx/2024/07/10/the-layout-types/>
VANCOUVER
Gaetan Gasoline | Sciencx - » The Layout types. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/10/the-layout-types/
CHICAGO
" » The Layout types." Gaetan Gasoline | Sciencx - Accessed . https://www.scien.cx/2024/07/10/the-layout-types/
IEEE
" » The Layout types." Gaetan Gasoline | Sciencx [Online]. Available: https://www.scien.cx/2024/07/10/the-layout-types/. [Accessed: ]
rf:citation
» The Layout types | Gaetan Gasoline | Sciencx | https://www.scien.cx/2024/07/10/the-layout-types/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.