Commit b381e0db authored by pacome's avatar pacome

[client/geothermie] added 2 more steps to hide top and bottom map --- WIP

parent 23dd7495
......@@ -30,7 +30,13 @@ export type System = io.TypeOf<typeof SystemIO>;
// tslint:disable-next-line: variable-name
export const DisplayMapsSeparatorIO = io.union(
[io.literal('top'), io.literal('middle'), io.literal('bottom')],
[
io.literal('hypertop'),
io.literal('top'),
io.literal('middle'),
io.literal('bottom'),
io.literal('hyperbottom')
],
'DisplayMapsSeparatorIO'
);
......
......@@ -10,69 +10,94 @@ import { fetchTile } from '../remote';
import { updateCollection } from 'sdi/util';
import { fromNullable } from 'fp-ts/lib/Option';
import { CakeMode } from '../components/cake';
import { getMoreTextHiddenArray, getLayersThicknesses } from '../queries/geothermie';
import {
getMoreTextHiddenArray,
getLayersThicknesses
} from '../queries/geothermie';
import { MoreTextHidden } from '../components/table/format';
import { ConnectName, ConnectData, defaultConnect } from '../components/table/connect';
export const setAddress =
(lang: MessageRecordLang, a: IUgWsAddress) =>
dispatch('geo/address',
ga => fromNullable(ga).fold(
{ [lang]: a },
as => updateCollection(as, lang, a)));
import {
ConnectName,
ConnectData,
defaultConnect
} from '../components/table/connect';
export const setAddress = (lang: MessageRecordLang, a: IUgWsAddress) =>
dispatch('geo/address', ga =>
fromNullable(ga).fold({ [lang]: a }, as =>
updateCollection(as, lang, a)
)
);
export const resetAddress = () => assign('geo/address', null);
export const setSystem =
(s: System) => assign('geo/system', s);
export const setSystem = (s: System) => assign('geo/system', s);
export const resetSystem =
() => assign('geo/system', null);
export const resetSystem = () => assign('geo/system', null);
export const setDisplayMapsSeparator =
(m: DisplayMapsSeparator) => assign('geo/display/maps/separator', m);
export const setDisplayMapsSeparator = (m: DisplayMapsSeparator) =>
assign('geo/display/maps/separator', m);
export const mapsSeparatorMoveUp =
() => assign(
// export const mapsSeparatorMoveUp =
// () => assign(
// 'geo/display/maps/separator',
// query('geo/display/maps/separator') === 'bottom' ? 'middle' : 'top'
// );
export const mapsSeparatorMoveUp = () =>
assign(
'geo/display/maps/separator',
query('geo/display/maps/separator') == 'bottom' ? 'middle' : 'top'
query('geo/display/maps/separator') == 'hyperbottom'
? 'bottom'
: // tslint:disable-next-line: no-constant-condition
'bottom'
? 'middle'
: // tslint:disable-next-line: no-constant-condition
'middle'
? 'top'
: 'hypertop'
);
export const mapsSeparatorMoveDown =
() => assign(
export const mapsSeparatorMoveDown = () =>
assign(
'geo/display/maps/separator',
query('geo/display/maps/separator') == 'top' ? 'middle' : 'bottom'
query('geo/display/maps/separator') == 'hypertop'
? 'top'
: // tslint:disable-next-line: no-constant-condition
'top'
? 'middle'
: // tslint:disable-next-line: no-constant-condition
'middle'
? 'bottom'
: 'hyperbottom'
);
export const setXY =
(x: number, y: number) => assign('geo/xy', { x, y });
export const setDataPoint =
(d: DepthPoint) => {
assign('geo/data/point', d);
updateCarrotConnect();
};
export const setXY = (x: number, y: number) => assign('geo/xy', { x, y });
export const setDataConstraint =
(c: ConstraintPoint) => assign('geo/data/constraint', c);
export const setDisplayData =
(b: boolean) => assign('geo/display/dataswitch', b);
export const setDataPoint = (d: DepthPoint) => {
assign('geo/data/point', d);
updateCarrotConnect();
};
export const setDataConstraint = (c: ConstraintPoint) =>
assign('geo/data/constraint', c);
export const toggleDataswitcher =
() => setDisplayData(!query('geo/display/dataswitch'));
export const setDisplayData = (b: boolean) =>
assign('geo/display/dataswitch', b);
export const tileKeyFromView =
(x: number, y: number, z: number) => `${snap(x)}/${snap(y)}/${snap(z, 1)}`;
export const toggleDataswitcher = () =>
setDisplayData(!query('geo/display/dataswitch'));
export const tileKeyFromView = (x: number, y: number, z: number) =>
`${snap(x)}/${snap(y)}/${snap(z, 1)}`;
export const loadTile =
(x: number, y: number, z: number) =>
fetchTile(snap(x), snap(y), snap(z, 1))
.then(t => dispatch('geo/tiles', ts => updateCollection(ts, tileKeyFromView(x, y, z), t)));
export const loadTile = (x: number, y: number, z: number) =>
fetchTile(snap(x), snap(y), snap(z, 1)).then(t =>
dispatch('geo/tiles', ts =>
updateCollection(ts, tileKeyFromView(x, y, z), t)
)
);
observe('port/map/top/view', (v) => {
observe('port/map/top/view', v => {
const key = tileKeyFromView(v.center[0], v.center[1], v.zoom);
const tiles = query('geo/tiles');
if (!(key in tiles)) {
......@@ -80,42 +105,39 @@ observe('port/map/top/view', (v) => {
}
});
export const setGraphXy =
(xy: GraphXY) => assign('geo/graph/xy', xy);
export const setGraphXy = (xy: GraphXY) => assign('geo/graph/xy', xy);
export const setGraphSnapXy =
(xy: GraphXY) => assign('geo/graph/snap-xy', xy);
export const setGraphSnapXy = (xy: GraphXY) => assign('geo/graph/snap-xy', xy);
export const setMoreTextHidden =
(key: keyof MoreTextHidden, index: number) => {
const arr: boolean[] = getMoreTextHiddenArray(key);
arr[index] === true ? arr[index] = false : arr[index] = true;
const obj = {} as MoreTextHidden;
obj[key] = arr;
assign('geo/table/text-hidden', obj);
};
export const setMoreTextHidden = (key: keyof MoreTextHidden, index: number) => {
const arr: boolean[] = getMoreTextHiddenArray(key);
arr[index] === true ? (arr[index] = false) : (arr[index] = true);
const obj = {} as MoreTextHidden;
obj[key] = arr;
assign('geo/table/text-hidden', obj);
};
export const setRenderCake = (b: boolean) => assign('geo/cake/render', b);
export const setCakeMode = (m: CakeMode) => assign('geo/cake/mode', m);
export const updateConnect =
(name: ConnectName, updater: (d: ConnectData) => ConnectData) =>
dispatch('geo/connect',
data => updateCollection(
data,
name,
fromNullable(data[name])
.fold(updater(defaultConnect()), updater)));
export const updateConnect = (
name: ConnectName,
updater: (d: ConnectData) => ConnectData
) =>
dispatch('geo/connect', data =>
updateCollection(
data,
name,
fromNullable(data[name]).fold(updater(defaultConnect()), updater)
)
);
const updateCarrotConnect = () => {
const csnLeft: ConnectName[] = [
'carrot-conductivity',
'carrot-hydrology',
'carrot-open',
'carrot-open'
];
const csnRight: ConnectName[] = [
'close-carrot',
......@@ -124,16 +146,17 @@ const updateCarrotConnect = () => {
'open-carrot'
];
getLayersThicknesses()
.map((ts) => {
csnLeft.map(n => updateConnect(n, d => ({ ...d, left: ts.concat() })));
csnRight.map(n => updateConnect(n, d => ({ ...d, right: ts.concat() })));
});
dispatch('geo/connect', c => { console.log(c); return c; });
getLayersThicknesses().map(ts => {
csnLeft.map(n => updateConnect(n, d => ({ ...d, left: ts.concat() })));
csnRight.map(n =>
updateConnect(n, d => ({ ...d, right: ts.concat() }))
);
});
dispatch('geo/connect', c => {
console.log(c);
return c;
});
};
export const setDiagramHeight =
(n: number) => assign('geo/diagram/height', n);
\ No newline at end of file
export const setDiagramHeight = (n: number) => assign('geo/diagram/height', n);
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 42.464734 42.464734"
version="1.1"
id="svg8589"
sodipodi:docname="print-off.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
width="42.464733"
height="42.464733">
<metadata
id="metadata8593">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>carrot-on</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1024"
id="namedview8591"
showgrid="false"
inkscape:zoom="6.938761"
inkscape:cx="36.17748"
inkscape:cy="24.800369"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1-2"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<defs
id="defs8561">
<style
id="style8556">.cls-1,.cls-5,.cls-6{fill:none;}.cls-2{fill:#8db63c;}.cls-3{clip-path:url(#clip-path);}.cls-4{fill:#fff;}.cls-5{stroke:#1d1d1b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.17px;}.cls-6{stroke:#fff;stroke-width:3px;}</style>
<clipPath
id="clip-path">
<path
class="cls-1"
d="M 21.23,41 A 19.73,19.73 0 1 0 1.5,21.23 19.73,19.73 0 0 0 21.23,41"
id="path8558"
inkscape:connector-curvature="0"
style="fill:none" />
</clipPath>
</defs>
<title
id="title8563">carrot-on</title>
<g
id="Layer_2"
data-name="Layer 2"
clip-path="none"
transform="translate(8.8668584e-4,-1.2097794e-4)">
<g
id="Layer_1-2"
data-name="Layer 1">
<path
class="cls-2"
d="M 21.23,41 A 19.73,19.73 0 1 0 1.5,21.23 19.73,19.73 0 0 0 21.23,41"
id="path8565"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1" />
<g
class="cls-3"
clip-path="url(#clip-path)"
id="g8583" />
<circle
class="cls-6"
cx="21.23"
cy="21.23"
r="19.73"
transform="rotate(-10.9,21.243774,21.223489)"
id="circle8585"
style="fill:none;stroke:#ffffff;stroke-width:3px" />
</g>
</g>
<path
inkscape:connector-curvature="0"
d="M 13.878714,30.935076 H 28.203729 V 26.842215 H 13.878714 Z m 0,-10.232153 H 28.203729 V 14.56363 H 25.64569 c -0.84735,0 -1.534823,-0.687473 -1.534823,-1.534823 V 10.470769 H 13.878714 Z m 18.417877,1.023215 c 0,-0.559574 -0.463642,-1.023215 -1.023216,-1.023215 -0.559573,0 -1.023216,0.463641 -1.023216,1.023215 0,0.559567 0.463643,1.023215 1.023216,1.023215 0.559574,0 1.023216,-0.463648 1.023216,-1.023215 z m 2.04643,0 v 6.6509 c 0,0.27179 -0.239817,0.511608 -0.511608,0.511608 h -3.581254 v 2.558038 c 0,0.847351 -0.687472,1.534823 -1.534823,1.534823 h -15.34823 c -0.847351,0 -1.534823,-0.687472 -1.534823,-1.534823 V 28.888646 H 8.2510281 c -0.2717906,0 -0.511608,-0.239818 -0.511608,-0.511608 v -6.6509 c 0,-1.678715 1.390932,-3.069646 3.0696459,-3.069646 h 1.023217 V 9.9591609 c 0,-0.8473507 0.687472,-1.5348231 1.534823,-1.5348231 h 10.743761 c 0.847351,0 2.014452,0.4796284 2.621991,1.087168 l 2.430133,2.4301332 c 0.607534,0.607533 1.087168,1.77464 1.087168,2.621991 v 4.092862 h 1.023216 c 1.678715,0 3.069646,1.390931 3.069646,3.069646 z"
id="path2"
style="stroke-width:0.01598774" />
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 42.464734 42.464734"
version="1.1"
id="svg8589"
sodipodi:docname="print-on.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
width="42.464733"
height="42.464733">
<metadata
id="metadata8593">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>carrot-on</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1024"
id="namedview8591"
showgrid="false"
inkscape:zoom="6.938761"
inkscape:cx="36.17748"
inkscape:cy="24.800369"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="svg8589"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<defs
id="defs8561">
<style
id="style8556">.cls-1,.cls-5,.cls-6{fill:none;}.cls-2{fill:#8db63c;}.cls-3{clip-path:url(#clip-path);}.cls-4{fill:#fff;}.cls-5{stroke:#1d1d1b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.17px;}.cls-6{stroke:#fff;stroke-width:3px;}</style>
<clipPath
id="clip-path">
<path
class="cls-1"
d="M 21.23,41 A 19.73,19.73 0 1 0 1.5,21.23 19.73,19.73 0 0 0 21.23,41"
id="path8558"
inkscape:connector-curvature="0"
style="fill:none" />
</clipPath>
</defs>
<title
id="title8563">carrot-on</title>
<g
id="Layer_2"
data-name="Layer 2"
clip-path="none"
transform="translate(8.8668584e-4,-1.2097794e-4)">
<g
id="Layer_1-2"
data-name="Layer 1">
<path
class="cls-2"
d="M 21.23,41 A 19.73,19.73 0 1 0 1.5,21.23 19.73,19.73 0 0 0 21.23,41"
id="path8565"
inkscape:connector-curvature="0"
style="fill:#8db63c" />
<g
class="cls-3"
clip-path="url(#clip-path)"
id="g8583" />
<circle
class="cls-6"
cx="21.23"
cy="21.23"
r="19.73"
transform="rotate(-10.9,21.243774,21.223489)"
id="circle8585"
style="fill:none;stroke:#ffffff;stroke-width:3px" />
</g>
</g>
<path
inkscape:connector-curvature="0"
d="M 13.878714,30.935076 H 28.203729 V 26.842215 H 13.878714 Z m 0,-10.232153 H 28.203729 V 14.56363 H 25.64569 c -0.84735,0 -1.534823,-0.687473 -1.534823,-1.534823 V 10.470769 H 13.878714 Z m 18.417877,1.023215 c 0,-0.559574 -0.463642,-1.023215 -1.023216,-1.023215 -0.559573,0 -1.023216,0.463641 -1.023216,1.023215 0,0.559567 0.463643,1.023215 1.023216,1.023215 0.559574,0 1.023216,-0.463648 1.023216,-1.023215 z m 2.04643,0 v 6.6509 c 0,0.27179 -0.239817,0.511608 -0.511608,0.511608 h -3.581254 v 2.558038 c 0,0.847351 -0.687472,1.534823 -1.534823,1.534823 h -15.34823 c -0.847351,0 -1.534823,-0.687472 -1.534823,-1.534823 V 28.888646 H 8.2510281 c -0.2717906,0 -0.511608,-0.239818 -0.511608,-0.511608 v -6.6509 c 0,-1.678715 1.390932,-3.069646 3.0696459,-3.069646 h 1.023217 V 9.9591609 c 0,-0.8473507 0.687472,-1.5348231 1.534823,-1.5348231 h 10.743761 c 0.847351,0 2.014452,0.4796284 2.621991,1.087168 l 2.430133,2.4301332 c 0.607534,0.607533 1.087168,1.77464 1.087168,2.621991 v 4.092862 h 1.023216 c 1.678715,0 3.069646,1.390931 3.069646,3.069646 z"
id="path2"
style="stroke-width:0.01598774" />
</svg>
......@@ -8,6 +8,14 @@
.absolute(0, 0, 0, 0);
}
&.hyperbottom {
.content-top {
flex: 1;
}
.content-bottom {
display: none;
}
}
&.bottom {
.content-top {
flex: 2.5;
......@@ -32,6 +40,14 @@
flex: 2.5;
}
}
&.hypertop {
.content-top {
flex: 1;
}
.content-bottom {
display: none;
}
}
}
.content-top {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment