2 import { slide } from 'svelte/transition'
3 import { quintOut } from 'svelte/easing';
4 import {onMount, afterUpdate, onDestroy, getContext} from 'svelte'
5 import {sex,now} from '$lib/Y/Pic'
6 import {o_} from '$lib/St'
7 import {sip_wiree, reConstruct} from '$lib/Co'
8 import Coning from '$lib/Coning.svelte';
9 // < look into https://github.com/kaisermann/svelte-loadable to name these at runtime
10 import Cont from '$lib/pi/Cont.svelte';
11 import Conz from '$lib/pi/Conz.svelte';
12 import Dir from '$lib/pi/Dir.svelte';
13 import Rec from '$lib/pi/Rec.svelte';
14 import Kom from '$lib/pi/Kom.svelte';
15 import Chart from '$lib/ui/Chart.svelte';
16 let pis = {Cont, Conz, Dir, Rec,Kom}
17 // our instructions: (-Con/(-Cont|-Conz))**
19 let boost = C.c.boost || 0
21 // only changes when we are sent an update specifically
28 // TODO not sure how to get boost into the toCon process
29 function boosting (e, negate=false) {
30 negate = e.ctrlKey || negate
31 boost += negate ? -1 : 1
34 // saves having to click ring() at the top
35 // however: we dont reiterate the source data from the top,
36 // so often opening Dir** and looking at the D** generated
37 // require ring() to get the most unfolded D**
42 // label from above (key into here - Cont%Ct is the s.t on the inside)
49 sip = C.c.ip.join('.')
50 C.y.boosting = boosting
55 //if (sip == '1.2.1.2.2') debugger
59 // the div|space that wraps everything in Con
61 // Con update version?
63 let spam = {C,update_num:0,N:[]}
64 let geometricating = C.t == 'treeh 16'
67 let oldness = now() - spam.asat
70 let version = spam.update_num++
71 if (!geometricating) return
72 let geo = wrapper.getBoundingClientRect().toJSON()
73 let ge = sex({},geo,'width,height,top,left')
77 // console.log("Geometry "+version+": "+C.t,ge)
79 spam.update && spam.update()
84 // refreshing the process, when children want to adjust things
88 // < this wants overlaying|geo via a parent
91 // avoid stating this twice (as Con.t and Cont%Ct)
93 if (C.sc.avoid_restating_Ct) {
102 <div bind:this={wrapper}>
104 <Chart {spam} vers={spam.update_num}/>
107 {#if !no_label}<span style="color:deepskyblue" on:pointerdown={(e) => boosting(e)}>{t}</span>{/if}
108 {#if boost} <span style="color:blueviolet" on:pointerdown={(e) => boosting(e,'negate')}>+{boost}</span>{/if}
109 {#if C.c.unwired} <span style="color:red">!wired</span>{/if}
111 <!-- <c_sip style="font-size:70%" on:pointerdown={(e) => datadump = 1}> {sip} </c_sip> -->
113 <!-- data dump (leaving the mind our Con** is from) -->
114 <Coning C={C.c.s} noC />
116 <!-- <revision style="color:darkcyan; text-decoration:underline">{quee}</revision> -->
119 {#each o_(C) as n (n.t)}
120 <span transition:slide={{ duration, easing: quintOut }}
121 style="display:inline-block; vertical-align: middle; border:2px solid gainsboro; border-right:none; padding: 0 3px; margin: 0 3px; border-radius: 3px;">
122 <svelte:component on:reCon="{reCon}" this={pis[n.c.pi]} C={n}/>