Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leximpact-socio-fiscal-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur socio-fiscal
leximpact-socio-fiscal-ui
Commits
61d4c3fb
Commit
61d4c3fb
authored
Apr 7, 2021
by
Emmanuel Raviart
Browse files
Options
Downloads
Patches
Plain Diff
Allow to open & close decomposition tree in waterfall.
parent
2c19fe76
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib/DecompositionTree.svelte
+48
-7
48 additions, 7 deletions
src/lib/DecompositionTree.svelte
src/routes/calculations/index.svelte
+9
-4
9 additions, 4 deletions
src/routes/calculations/index.svelte
with
57 additions
and
11 deletions
src/lib/DecompositionTree.svelte
+
48
−
7
View file @
61d4c3fb
...
...
@@ -2,17 +2,58 @@
import
type
{
Decomposition
}
from
"
$lib/decompositions
"
export
let
decomposition
:
Decomposition
export
let
index
:
number
export
let
open
:
boolean
export
let
showNulls
:
boolean
export
let
vectorIndex
:
number
</script>
<span>
{
Math
.
round
(
decomposition
.
delta
[
index
])
}
€
</span>
<span>
{
decomposition
.
short_name
}
</span>
{
#if
decomposition
.
children
!==
undefined
}
<ul
class=
"list-disc list-inside ml-4"
>
<button
class=
"flex"
on:click=
{
()
=>
(
open
=
!
open
)
}
>
{
#if
decomposition
.
children
===
undefined
}
<span
class=
"h5 w-5"
/>
{
:else
if
open
}
<!-- Heroicon name: solid/chevron-down -->
<svg
class=
"h-5 inline w-5"
fill=
"currentColor"
viewBox=
"0 0 20 20"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
clip-rule=
"evenodd"
d=
"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
fill-rule=
"evenodd"
/>
</svg>
{
:
else
}
<!-- Heroicon name: solid/chevron-right -->
<svg
class=
"h-5 inline w-5"
fill=
"currentColor"
viewBox=
"0 0 20 20"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
clip-rule=
"evenodd"
d=
"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
fill-rule=
"evenodd"
/>
</svg>
{
/if
}
<span>
{
Math
.
round
(
decomposition
.
delta
[
vectorIndex
])
}
€
</span>
<span
class=
"ml-2"
>
{
decomposition
.
short_name
}
</span>
</button>
{
#if
open
&&
decomposition
.
children
!==
undefined
}
<ul
class=
"ml-4"
>
{
#each
decomposition
.
children
as
child
}
{
#if
showNulls
||
child
.
delta
[
index
]
!==
0
}
<li><svelte:self
decomposition=
{
child
}
{
index
}
{
showNulls
}
/>
</li>
{
#if
showNulls
||
child
.
delta
[
vectorIndex
]
!==
0
}
<li>
<svelte:self
decomposition=
{
child
}
open=
{
false
}
{
vectorIndex
}
{
showNulls
}
/>
</li>
{
/if
}
{
/each
}
</ul>
...
...
This diff is collapsed.
Click to expand it.
src/routes/calculations/index.svelte
+
9
−
4
View file @
61d4c3fb
...
...
@@ -148,13 +148,18 @@
<div>
<button
on:click=
{
submit
}
>
Simuler
</button>
</div>
{
index
}
<div
class=
"flex"
>
<div>
<DecompositionTree
{
decomposition
}
{
index
}
{
showNulls
}
/>
<div
class=
"flex-shrink-0"
>
<DecompositionTree
{
decomposition
}
open=
{
true
}
{
showNulls
}
vectorIndex=
{
index
}
/>
</div>
<Waterfall
{
decomposition
}
{
index
}
{
showNulls
}
/>
<Waterfall
{
decomposition
}
{
showNulls
}
{
index
}
/>
</div>
<label
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment