Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Enable users to change the view title color (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Budiu authored Oct 20, 2020
1 parent f38dc89 commit 2be2b36
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/userManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ one row for an airline flight. Columns in this dataset include: the date of the
the origin and destination cities, the origin and destination states,
the origin airport code, the distance flown, the departure and arrival delay.

Updated on 2020 Sep 29.
Updated on 2020 Oct 19.

# Contents
* 1 [Basic concepts](#1-basic-concepts)
Expand Down Expand Up @@ -855,6 +855,9 @@ with x.

![View heading](view-heading.png)

The color picker rectangle allows you to change the color of the title
to make it easier to visually navigate; the color of a view is inherited
by all views that are spawned by it.
The two black triangles in the view heading allow the view to be moved
up and down on the web page. The axis markers X, Y, and G can be
dragged between some views; dropping them will "move" the
Expand Down
3 changes: 3 additions & 0 deletions docs/userManual.src
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,9 @@ with x.

![View heading](view-heading.png)

The color picker rectangle allows you to change the color of the title
to make it easier to visually navigate; the color of a view is inherited
by all views that are spawned by it.
The two black triangles in the view heading allow the view to be moved
up and down on the web page. The axis markers X, Y, and G can be
dragged between some views; dropping them will "move" the
Expand Down
Binary file modified docs/view-heading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.junit.Test;

import java.time.Instant;
import java.time.temporal.TemporalUnit;
import java.util.Collections;

public class RowSnapShotTest extends BaseTest {
Expand Down
2 changes: 2 additions & 0 deletions web/src/main/webapp/datasetView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ export class DatasetView implements IHtmlElement {
public newPage(title: PageTitle, sourcePage: FullPage | null): FullPage {
const num = this.pageCounter++;
const page = new FullPage(num, title, sourcePage != null ? sourcePage.pageId : null, this);
if (sourcePage != null)
page.setTitleColor(sourcePage.getColor());
this.insertAfter(page, sourcePage);
return page;
}
Expand Down
15 changes: 15 additions & 0 deletions web/src/main/webapp/ui/fullPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ export class FullPage implements IHtmlElement {
h2.appendChild(refLink);
}

const picker = document.createElement("input");
picker.type = "color";
picker.style.width = "20px";
picker.value = "#ffffff";
picker.oninput = () => { this.setTitleColor(picker.value); };
this.addCell(picker, true);

if (this.dataset != null) {
this.eBox = makeSpan(SpecialChars.epsilon);
this.eBox.title = "Data is shown with differential privacy.";
Expand Down Expand Up @@ -259,6 +266,10 @@ export class FullPage implements IHtmlElement {
this.bottomContainer.appendChild(this.console.getHTMLRepresentation());
}

public getColor(): string {
return this.titleRow.style.background;
}

public changeEpsilon(): void {
if (this.epsilonColumns == null)
return;
Expand Down Expand Up @@ -468,4 +479,8 @@ export class FullPage implements IHtmlElement {
public scrollIntoView(): void {
this.getHTMLRepresentation().scrollIntoView( { block: "end", behavior: "smooth" } );
}

setTitleColor(color: string): void {
this.titleRow.style.background = color;
}
}

0 comments on commit 2be2b36

Please sign in to comment.