Initial fan graph widget

This commit is contained in:
Luke D. Jones
2024-03-12 21:33:39 +13:00
parent 2558057e9f
commit 5fd107df27
3 changed files with 154 additions and 14 deletions

View File

@@ -1,16 +1,48 @@
import { Palette } from "std-widgets.slint";
import { Graph } from "../widgets/graph.slint";
export struct Node { x: length, y: length}
export component PageFans inherits VerticalLayout {
Rectangle {
clip: true;
// TODO: slow with border-radius
padding: 8px;
// height: parent.height - infobar.height - mainview.padding - self.padding * 2;
// TODO: border-radius: 8px;
mainview := VerticalLayout {
padding: 10px;
spacing: 10px;
Text {
text: "TODO";
}
in-out property <[Node]> nodes: [
{
x: 10px,
y: 10px,
},
{
x: 40px,
y: 30px,
},
{
x: 70px,
y: 50px,
},
{
x: 100px,
y: 70px,
},
{
x: 130px,
y: 90px,
},
{
x: 160px,
y: 110px,
},
{
x: 190px,
y: 130px,
},
{
x: 220px,
y: 150px,
},
];
HorizontalLayout {
Graph {
// width: root.preferred-width;
// height: root.preferred-height;
nodes <=> root.nodes;
}
}
}