# HG changeset patch # User drewp@bigasterisk.com # Date 1685829066 25200 # Node ID 83135b0c8bba8502e8b8dfdb8d3a16b93e912efe # Parent af38643cffd44258ce0f12c058279abedccc8644 sort faders in a page by column diff -r af38643cffd4 -r 83135b0c8bba light9/fade/Light9FadeUi.ts --- a/light9/fade/Light9FadeUi.ts Sat Jun 03 13:10:24 2023 -0700 +++ b/light9/fade/Light9FadeUi.ts Sat Jun 03 14:51:06 2023 -0700 @@ -10,12 +10,16 @@ export { EditChoice } from "../web/EditChoice"; export { Light9EffectFader } from "./Light9EffectFader"; -debug.enable("*,autodep"); +debug.enable("*,-autodep"); const log = debug("fade"); +class FaderConfig { +constructor(public uri: NamedNode,public column: number){} +} + class FadePage { constructor(public uri: NamedNode) {} - faders: NamedNode[] = []; + faders: FaderConfig[] = []; } class FadePages { pages: FadePage[] = []; @@ -56,7 +60,7 @@ `} - ${page.faders.map((fd) => html` `)} + ${page.faders.map((fd) => html` `)} `; } @@ -86,11 +90,11 @@ const fp = new FadePage(page as NamedNode); try { for (let fader of this.graph.objects(page, U(":fader"))) { - fp.faders.push(fader as NamedNode); + const colLit = this.graph.stringValue(fader, U(':column')) + fp.faders.push(new FaderConfig(fader as NamedNode, parseFloat(colLit))); } fp.faders.sort((a, b) => { - // todo this is supposed to sort by :column so you can reorder - return a.value.localeCompare(b.value); + return a.column-(b.column); }); fadePages.pages.push(fp); } catch (e) {}