Skip to content

Commit

Permalink
refactor: rename model to system in ui (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkier authored Sep 28, 2023
1 parent 1b7336c commit 9e4eb92
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
}
function refreshParams(e: CustomEvent, currentParam: Dimensions) {
let label = e.detail.label as 'models' | 'slices';
let paramExcluMap = { slices: SlicesOrModels.MODELS, models: SlicesOrModels.SLICES };
let label = e.detail.label as 'systems' | 'slices';
let paramExcluMap = { slices: SlicesOrModels.MODELS, systems: SlicesOrModels.SLICES };
if (currentParam === Dimensions.y) {
parameters.yChannel = e.detail.value;
Expand Down Expand Up @@ -124,7 +124,7 @@
value={parameters.yChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={refreshY}
Expand Down Expand Up @@ -155,7 +155,7 @@
value={parameters.colorChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={refreshColor}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
value={parameters.xChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={refreshX}
Expand All @@ -100,7 +100,7 @@
value={parameters.yChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={refreshY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
value={parameters.axisChannel}
options={[
{ label: 'slices', value: SlicesMetricsOrModels.SLICES },
{ label: 'models', value: SlicesMetricsOrModels.MODELS },
{ label: 'systems', value: SlicesMetricsOrModels.MODELS },
{ label: 'metrics', value: SlicesMetricsOrModels.METRICS }
]}
searchable={false}
Expand All @@ -144,7 +144,7 @@
value={parameters.layerChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={refreshLayerParams}
Expand All @@ -166,7 +166,7 @@
value={parameters.fixedChannel}
options={[
{ label: 'slices', value: SlicesMetricsOrModels.SLICES },
{ label: 'models', value: SlicesMetricsOrModels.MODELS },
{ label: 'systems', value: SlicesMetricsOrModels.MODELS },
{ label: 'metrics', value: SlicesMetricsOrModels.METRICS }
]}
searchable={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
value={parameters.xChannel}
options={[
{ label: 'slices', value: SlicesMetricsOrModels.SLICES },
{ label: 'models', value: SlicesMetricsOrModels.MODELS },
{ label: 'systems', value: SlicesMetricsOrModels.MODELS },
{ label: 'metrics', value: SlicesMetricsOrModels.METRICS }
]}
searchable={false}
Expand All @@ -149,7 +149,7 @@
value={parameters.yChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={yChanged}
Expand All @@ -172,7 +172,7 @@
slot="component"
options={[
{ label: 'slices', value: SlicesMetricsOrModels.SLICES },
{ label: 'models', value: SlicesMetricsOrModels.MODELS },
{ label: 'systems', value: SlicesMetricsOrModels.MODELS },
{ label: 'metrics', value: SlicesMetricsOrModels.METRICS }
]}
searchable={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
}
function refreshParams(e: CustomEvent, currentParam: Dimensions) {
let label = e.detail.label as 'models' | 'slices';
let paramExcluMap = { slices: SlicesOrModels.MODELS, models: SlicesOrModels.SLICES };
let label = e.detail.label as 'systems' | 'slices';
let paramExcluMap = { slices: SlicesOrModels.MODELS, systems: SlicesOrModels.SLICES };
if (currentParam === Dimensions.x) {
parameters.xChannel = e.detail.value;
Expand Down Expand Up @@ -66,7 +66,7 @@
value={parameters.xChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={xChanged}
Expand Down Expand Up @@ -94,7 +94,7 @@
value={parameters.colorChannel}
options={[
{ label: 'slices', value: SlicesOrModels.SLICES },
{ label: 'models', value: SlicesOrModels.MODELS }
{ label: 'systems', value: SlicesOrModels.MODELS }
]}
searchable={false}
on:change={colorChaned}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default function generateSpec(
height: number,
width: number
): VegaLiteSpec {
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'model' : 'slice';
const color_name = parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'model';
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'system' : 'slice';
const color_name = parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'system';

const spec = {
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function generateSpec(
? [
{
type: 'symbol',
title: parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'model',
title: parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'system',
fill: 'color'
}
]
Expand Down Expand Up @@ -109,9 +109,9 @@ export default function generateSpec(
zindex: { value: 1 },
tooltip: {
signal: `{'size': datum.size, '${xLabel}': format(datum.x_value, '.4f'), '${
parameters.yChannel === SlicesOrModels.MODELS ? 'model' : 'slice'
parameters.yChannel === SlicesOrModels.MODELS ? 'system' : 'slice'
}': datum.y_value, '${
parameters.colorChannel === SlicesOrModels.MODELS ? 'model' : 'slice'
parameters.colorChannel === SlicesOrModels.MODELS ? 'system' : 'slice'
}': datum.color_value}`
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default function generateSpec(
parameters: HeatmapParameters,
metricName: string
): VegaLiteSpec {
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'model' : 'slice';
const y_name = parameters.yChannel === SlicesOrModels.SLICES ? 'slice' : 'model';
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'system' : 'slice';
const y_name = parameters.yChannel === SlicesOrModels.SLICES ? 'slice' : 'system';

return {
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default function generateSpec(
width: number,
height: number
): VegaLiteSpec {
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'model' : 'slice';
const color_name = parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'model';
const x_name = parameters.xChannel === SlicesOrModels.MODELS ? 'system' : 'slice';
const color_name = parameters.colorChannel === SlicesOrModels.SLICES ? 'slice' : 'system';

return {
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function generateSpec(
{
fill: 'color',
orient: 'none',
title: parameters.layerChannel === SlicesOrModels.SLICES ? 'slice' : 'model',
title: parameters.layerChannel === SlicesOrModels.SLICES ? 'slice' : 'system',
encode: {
legend: { update: { x: { value: 300 }, y: { value: -250 } } }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
<Head>
<Row>
<Cell
>{parameters.yChannel === SlicesOrModels.SLICES ? 'slices' : 'models'} \ {parameters.xChannel ===
>{parameters.yChannel === SlicesOrModels.SLICES ? 'slices' : 'systems'} \ {parameters.xChannel ===
SlicesMetricsOrModels.SLICES
? 'slices'
: parameters.xChannel === SlicesMetricsOrModels.MODELS
? 'models'
? 'systems'
: 'metrics'}</Cell
>
{#each columns as column}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/general/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
<div class="flex flex-col mt-3">
<HeaderIcon
pageName={'explore'}
tooltipContent={'Explore your data and model outputs'}
tooltipContent={'Explore your data and system outputs'}
icon={mdiCompassOutline}
on:click={() => goto(`${getProjectRouteFromURL($page.url)}/explore`)}
/>
{#if $models.length > 1}
<HeaderIcon
pageName={'compare'}
tooltipContent={'Qualitatively compare model outputs'}
tooltipContent={'Qualitatively compare system outputs'}
icon={mdiCompare}
on:click={() => goto(`${getProjectRouteFromURL($page.url)}/compare`)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{/if}
{#if entry[modelColumn]}
<hr />
<pre class="mt-2 mb-0">model prediction</pre>
<pre class="mt-2 mb-0">prediction</pre>
<HighlightAuto code={entry[modelColumn]} />
{/if}
</div>
4 changes: 2 additions & 2 deletions frontend/src/lib/components/metadata/MetadataHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{#if $model !== undefined && $models.length > 0}
<div class="mr-2.5 flex flex-col w-1/2">
<span class="my-1 text-grey-dark w-fit">
{$page.url.href.includes('compare') ? 'Model A' : 'Model'}
{$page.url.href.includes('compare') ? 'System A' : 'System'}
</span>
<select
class="w-full h-9 border border-grey-light rounded text-sm text-grey"
Expand Down Expand Up @@ -51,7 +51,7 @@
{/if}
{#if $page.url.href.includes('compare')}
<div class="flex flex-col w-1/2">
<span class="my-1 text-grey-dark">Model B</span>
<span class="my-1 text-grey-dark">System B</span>
<select
class="w-full h-9 border border-grey-light rounded text-sm text-grey"
bind:value={$comparisonModel}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/metadata/SliceHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
use:tooltip={{
content: !$page.url.href.includes('compare')
? 'Find underperforming slices'
: 'Find slices with the largest output differences between models',
: 'Find slices with the largest output differences between systems',
position: 'left',
theme: 'zeno-tooltip',
maxWidth: '150'
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/lib/components/popups/SliceFinderPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
class="w-6 h-6 cursor-help fill-grey-dark"
use:tooltip={{
content: $page.url.href.includes('compare')
? 'Run the SliceLine algorithm to find slices with the largest or smallest average difference in a difference column between two models'
? 'Run the SliceLine algorithm to find slices with the largest or smallest average difference in a difference column between two systems'
: 'Run the SliceLine algorithm to find slices of data with high or low metrics',
position: 'right',
theme: 'zeno-tooltip',
Expand Down Expand Up @@ -170,7 +170,7 @@
style="margin-top: 3px;"
use:tooltip={{
content: $page.url.href.includes('compare')
? 'The column on which to measure model disagreement'
? 'The column on which to measure system disagreement'
: 'The continuous column to compare slices across',
position: 'right',
theme: 'zeno-tooltip',
Expand Down Expand Up @@ -280,7 +280,7 @@
style="margin-top: 3px;"
use:tooltip={{
content: $page.url.href.includes('compare')
? 'Order by slice score, a combination of model difference and size'
? 'Order by slice score, a combination of system difference and size'
: 'Order by slice score, a combination of size and metric',
theme: 'zeno-tooltip',
position: 'left',
Expand All @@ -296,7 +296,7 @@
style="width: 120px; margin-right: 20px"
bind:value={orderByIdx}
options={$page.url.href.includes('compare')
? ['(model) A > B', '(model) B > A']
? ['(system) A > B', '(system) B > A']
: orderByOptions}
placeholder="Order By"
/>
Expand Down

0 comments on commit 9e4eb92

Please sign in to comment.