Skip to content

Commit

Permalink
More style updates for tooltips and visualization page
Browse files Browse the repository at this point in the history
  • Loading branch information
edlu77 committed Oct 6, 2024
1 parent b951a66 commit 58bc2c9
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
:host {
display: block;
min-width: 545px;
min-width: 80rem;
background: url('../../../assets/backgrounds/create-visualization-page-background.png') no-repeat;
background-position: center;
background-size: cover;

hra-nav-header {
border-bottom: 1px solid var(--sys-outline);
height: 5rem;
}

.content {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
cde-create-visualization-page {
color: var(--sys-secondary);

hra-nav-header {
background-color: var(--sys-surface-container-high) !important;
}

.card {
background-color: var(--sys-surface-container-low);

Expand Down Expand Up @@ -42,7 +38,3 @@ cde-create-visualization-page {
}
}
}

.info-tooltip-panel {
background-color: var(--sys-on-primary);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
background-color: var(--sys-surface-container-low);
min-width: 20rem;

hra-nav-header {
height: 5.25rem;
}

.create-explore-content {
padding: 3rem 1rem 5rem 1rem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
appIcon="assets/logo/cde_logo.svg"
appTitle="Cell Distance Explorer"
variant="fixed"
appDescription="Beta"
>
</hra-app-logos>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,50 +1,7 @@
::ng-deep {
.info-tooltip-panel {
background-color: white;
box-shadow: 0 0.3125rem 1rem 0 #201e3d3d;
border-radius: 0.5rem;
max-width: 21rem;

.break {
margin-bottom: 1rem;
}

div,
span {
font-family: 'Metropolis';
font-size: 0.875rem;
line-height: 1.3125rem;
letter-spacing: 0.005em;
font-weight: 500;
color: #4c4c58;
}

div {
margin: 1rem;

span {
display: block;
}
}
}
}

::ng-deep .download-snackbar-panel {
--mdc-snackbar-container-color: var(--sys-surface-container);
--mdc-snackbar-supporting-text-color: var(--sys-secondary);
translate: 0 -2rem;
text-align: center;

.mdc-snackbar__surface {
border-radius: 0.5rem !important;
min-width: 13rem !important;
}
}

:host {
width: 100%;
display: grid;
grid-template-columns: 22.75rem minmax(59rem, calc(100vw - 22.75rem));
grid-template-columns: 22.75rem minmax(57.25rem, calc(100vw - 22.75rem));
grid-template-rows: 4rem minmax(calc(900px - 4rem), calc(100vh - 4rem));
grid-template-areas:
'header visualization'
Expand Down Expand Up @@ -85,12 +42,23 @@
border-width: 0 0 2px 0;
border-style: solid;
height: 100%;
width: calc(100% - 488px);
}

cde-violin {
height: 100%;
width: 488px;
width: 390px;
}
}
}

::ng-deep .download-snackbar-panel {
--mdc-snackbar-container-color: var(--sys-surface-container);
--mdc-snackbar-supporting-text-color: var(--sys-secondary);
translate: 0 -2rem;
text-align: center;

.mdc-snackbar__surface {
border-radius: 0.5rem !important;
min-width: 13rem !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
[cdkConnectedOverlayOpen]="cellTypesInfoOpen"
[cdkConnectedOverlayOffsetX]="5"
>
<div>
Show/hide specific cell types in the visualizations by clicking the checkboxes. Update individual cell type
visualization colors by clicking the cell type's color legend button. Download a color map CSV file of the current
cell types and HEX codes.
</div>
<hra-tooltip-card
small
[content]="[
{
description:
'Show/hide specific cell types in the visualizations by clicking the checkboxes. Update individual cell type visualization colors by clicking the cell type\'s color legend button. Download a color map CSV file of the current cell types and HEX codes.',
},
]"
>
</hra-tooltip-card>
</ng-template>
</span>
<button mat-flat-button class="mat-caption download-csv" color="primary" (click)="download.emit()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
}

button.download-csv {
--mdc-filled-button-container-height: 2rem;
--mdc-filled-button-container-color: #d5dbe3;
--mdc-filled-button-label-text-color: #201e3d;

grid-area: download;
padding: 0.3438rem 0.5rem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { CellTypeEntry } from '../../models/cell-type';
import { Rgb } from '@hra-ui/design-system/color-picker';
import { TOOLTIP_POSITION_RIGHT_SIDE } from '../../shared/tooltip-position';
import { ColorPickerLabelComponent } from '../color-picker-label/color-picker-label.component';
import { TooltipCardComponent } from '@hra-ui/design-system/tooltip-card';

/**
* Cell Type Component
Expand All @@ -46,6 +47,7 @@ import { ColorPickerLabelComponent } from '../color-picker-label/color-picker-la
OverlayModule,
ColorPickerLabelComponent,
ScrollingModule,
TooltipCardComponent,
],
templateUrl: './cell-types.component.html',
styleUrl: './cell-types.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@
[cdkConnectedOverlayOpen]="infoOpen"
[cdkConnectedOverlayOffsetX]="5"
>
<div>
The graph shows a histogram of cell-to-nearest-anchor cell distance distributions categorized by each cell
type in the dataset.
</div>
<hra-tooltip-card
small
[content]="[
{
description:
'The graph shows a histogram of cell-to-nearest-anchor cell distance distributions categorized by each cell type in the dataset.',
},
]"
>
</hra-tooltip-card>
</ng-template>

<div class="filler"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
border-radius: 0.5rem;
height: fit-content;
position: sticky;
--mdc-filled-button-container-height: 2rem;
max-height: 22.5rem;
--mat-expansion-container-shape: 0;

.header {
padding: 0 1rem;
Expand All @@ -21,6 +21,8 @@
}

button {
--mdc-filled-button-container-height: 2rem;
--mdc-filled-button-container-color: #d5dbe3;
--mdc-filled-button-label-text-color: #201e3d;
padding: 0.375rem 0.5rem;
margin-left: 0.25rem;
Expand Down Expand Up @@ -69,16 +71,3 @@
::ng-deep .mat-content-hide-toggle {
margin-right: 0 !important;
}

::ng-deep {
#vg-tooltip-element.vg-tooltip {
font-family: 'Metropolis';
font-weight: 500;
font-size: 0.75rem;
line-height: 1.125rem;
color: #201e3d;
padding: 0.5rem;
max-width: 22.5rem;
box-shadow: 0px 5px 16px 0px #201e3d3d;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { FileSaverService } from '../../services/file-saver/file-saver.service';
import { TOOLTIP_POSITION_RIGHT_SIDE } from '../../shared/tooltip-position';
import { ColorPickerLabelComponent } from '../color-picker-label/color-picker-label.component';
import * as HISTOGRAM_SPEC from './histogram.vl.json';
import { TooltipCardComponent } from '@hra-ui/design-system/tooltip-card';

interface UpdateColorData {
entry: CellTypeEntry;
Expand Down Expand Up @@ -121,6 +122,7 @@ const DYNAMIC_COLOR_RANGE = Array(DYNAMIC_COLOR_RANGE_LENGTH)
ColorPickerLabelComponent,
OverlayModule,
ScrollingModule,
TooltipCardComponent,
],
providers: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@
[cdkConnectedOverlayOpen]="tooltipOpen"
[cdkConnectedOverlayOffsetX]="5"
>
<div>Visualization metadata for the sample dataset. Sample files may be viewed in Google Sheets.</div>
<hra-tooltip-card
small
[content]="[
{
description:
'Visualization metadata for the sample dataset. Sample files may be viewed in Google Sheets.',
},
]"
>
</hra-tooltip-card>
</ng-template>
</mat-panel-title>
</mat-expansion-panel-header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MatExpansionModule } from '@angular/material/expansion';
import { MatIconModule } from '@angular/material/icon';
import { Metadata } from '../../models/metadata';
import { TOOLTIP_POSITION_RIGHT_SIDE } from '../../shared/tooltip-position';
import { TooltipCardComponent } from '@hra-ui/design-system/tooltip-card';

/** List of metadata fields that can be hidden */
const HIDABLE_FIELDS: (keyof Metadata)[] = [
Expand Down Expand Up @@ -37,7 +38,15 @@ export class DefaultToPipe implements PipeTransform {
@Component({
selector: 'cde-metadata',
standalone: true,
imports: [CommonModule, MatButtonModule, MatIconModule, MatExpansionModule, OverlayModule, DefaultToPipe],
imports: [
CommonModule,
MatButtonModule,
MatIconModule,
MatExpansionModule,
OverlayModule,
DefaultToPipe,
TooltipCardComponent,
],
templateUrl: './metadata.component.html',
styleUrl: './metadata.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,7 @@
[cdkConnectedOverlayOpen]="tooltipOpen"
[cdkConnectedOverlayOffsetX]="5"
>
<div>
<ul>
Zoom Options
<li>Mouse pinwheel</li>
<li>Trackpad Pinch</li>
</ul>
<ul>
Pan Options
<li>CTRL/CMD + mouse drag</li>
<li>Right click + mouse drag</li>
<li>Keyboard arrows</li>
</ul>
<ul>
Rotation Options for 3D Visualizations
<li>CTRL/CMD + keyboard arrows</li>
<li>Mouse Drag</li>
</ul>
</div>
<hra-tooltip-card small [content]="tooltipContent"> </hra-tooltip-card>
</ng-template>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
z-index: 1;
align-items: center;
gap: 0.25rem;
color: white;
font-size: 1rem;
line-height: 1.5rem;
font: var(--sys-label-medium);
letter-spacing: var(--sys-label-medium-tracking);
color: #e6eaf0;

mat-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { EdgeEntry } from '../../models/edge';
import { NodeEntry } from '../../models/node';
import { FileSaverService } from '../../services/file-saver/file-saver.service';
import { TOOLTIP_POSITION_RIGHT_SIDE } from '../../shared/tooltip-position';
import { TooltipCardComponent, TooltipContent } from '@hra-ui/design-system/tooltip-card';

/** Utility type to convert properties of an object into an object with a value wrapper */
type Preactify<T> = {
Expand Down Expand Up @@ -73,7 +74,7 @@ function isNonEmptyArray<T>(array: T[]): boolean {
@Component({
selector: 'cde-node-dist-visualization',
standalone: true,
imports: [CommonModule, OverlayModule, MatButtonModule, MatIconModule],
imports: [CommonModule, OverlayModule, MatButtonModule, MatIconModule, TooltipCardComponent],
templateUrl: './node-dist-visualization.component.html',
styleUrl: './node-dist-visualization.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down Expand Up @@ -116,6 +117,22 @@ export class NodeDistVisualizationComponent {
/** Tooltip position constant */
readonly tooltipPosition = TOOLTIP_POSITION_RIGHT_SIDE;

/** Tooltip content */
readonly tooltipContent: TooltipContent[] = [
{
title: 'Zoom Options',
description: '• Mouse pinwheel \n• Trackpad Pinch',
},
{
title: 'Pan Options',
description: '• CTRL/CMD + mouse drag \n• Right click + mouse drag \n• Keyboard arrows',
},
{
title: 'Rotation Options for 3D Visualizations',
description: '• CTRL/CMD + keyboard arrows \n• Mouse Drag',
},
];

/** Flag to check if the tooltip is open */
tooltipOpen = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
[cdkConnectedOverlayOpen]="infoOpen"
[cdkConnectedOverlayOffsetX]="5"
>
<div>Violin plot</div>
<hra-tooltip-card
small
[content]="[
{
description:
'The graph shows a histogram of cell-to-nearest-anchor cell distance distributions categorized by each cell type in the dataset.',
},
]"
>
</hra-tooltip-card>
</ng-template>
</span>

Expand Down
Loading

0 comments on commit 58bc2c9

Please sign in to comment.