Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

feat(operators): operator browser page #34

Merged
merged 37 commits into from
Oct 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c95a00d
added stubs for all operators
btroncone Oct 3, 2017
11fc524
updated operator formatting
btroncone Oct 4, 2017
363484d
update lint settings
btroncone Oct 4, 2017
242b28d
correctly type doc objects
btroncone Oct 4, 2017
05fc934
styling and grouping updates
btroncone Oct 4, 2017
62cb886
basic operator outline
btroncone Oct 4, 2017
38f2c27
operator styling updates
btroncone Oct 4, 2017
ba8fbbf
sidenav navigation tweaks
btroncone Oct 4, 2017
e886d00
operator toc start
btroncone Oct 4, 2017
0cbec6f
operator styling progress
btroncone Oct 5, 2017
0f25ced
styling updates
btroncone Oct 6, 2017
90577f1
updated to material beta.12
btroncone Oct 6, 2017
a6985eb
operator navigation update
btroncone Oct 8, 2017
bfb948e
added highlight.js
btroncone Oct 8, 2017
acea05d
operator routing update
btroncone Oct 8, 2017
a43f86d
operator formatting update
btroncone Oct 9, 2017
5bc28e2
styling and formatting updates
btroncone Oct 9, 2017
bf4bd05
media helpers
btroncone Oct 9, 2017
94d4188
filling in info and styling updates
btroncone Oct 10, 2017
700b247
fixed source url
btroncone Oct 10, 2017
363f68f
merge upstream
btroncone Oct 10, 2017
f365292
update routing to module
btroncone Oct 10, 2017
317449b
split up operator components
btroncone Oct 10, 2017
2eaa156
added walkthrough
btroncone Oct 10, 2017
6c7f2c4
update active color
btroncone Oct 10, 2017
68a52b1
added copy + operator styling updates
btroncone Oct 11, 2017
a73d3b6
operator display tweaks
btroncone Oct 11, 2017
cdd9152
styling + quick link updates
btroncone Oct 12, 2017
df94a2c
Merge branch 'master' into operator-section
btroncone Oct 12, 2017
0bf3e2b
removed unused routes
btroncone Oct 13, 2017
0e681a0
added jsbin iframe for examples
btroncone Oct 16, 2017
a8311b7
rx-marbles integration + responsive updates
btroncone Oct 17, 2017
2b9614f
merge master
btroncone Oct 17, 2017
a912ee9
header styling update
btroncone Oct 17, 2017
a9ae9c8
added initial tests for operators component
btroncone Oct 18, 2017
d22320a
Merge remote-tracking branch 'upstream/master' into operator-section
btroncone Oct 20, 2017
f454d49
style(operators): split description between lines to fix linting problem
btroncone Oct 20, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ngsw-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
"external": {
"urls": [
{"url": "https://fonts.googleapis.com/icon?family=Material+Icons"},
{"url": "https://fonts.googleapis.com/css?family=Roboto"},
{"url": "https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700"},
{"url": "https://ajax.googleapis.com/ajax/libs/hammerjs/2.0.8/hammer.min.js"},
{"url": "https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.2.5/web-animations.min.js"}
{"url": "https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.2.5/web-animations.min.js"},
{"url": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/monokai_sublime.min.css"},
{"url": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js"},
{"url": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/typescript.min.js"},
{"url": "http://reactivex.io/rxjs/img/combineAll.png"},
{"url": "http://reactivex.io/rxjs/img/combineLatest.png"}
]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@types/hammerjs": "2.0.35",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ngx-clipboard": "8.1.0",
"rxjs": "5.4.2",
"zone.js": "0.8.14"
},
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<mat-sidenav-container>
<mat-sidenav #sidenav role="navigation">
<mat-nav-list (click)="sidenav.toggle()">
<a *ngFor="let menu of menus" mat-list-item routerLinkActive="active"
[routerLinkActiveOptions]="menu.options"
<a *ngFor="let menu of menus" mat-list-item routerLinkActive="active"
[routerLinkActiveOptions]="menu.options"
[routerLink]="menu.link">
{{menu.title}}
</a>
</mat-nav-list>
</mat-sidenav>
<main class="body-margin">
<main class="app-content">
<router-outlet></router-outlet>
</main>
</mat-sidenav-container>
Expand Down
35 changes: 35 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,38 @@
padding: 0 16px;
font-weight: 600;
}

.app-fullpage {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
flex-direction: column;

header {
z-index: 10;
}
}

mat-sidenav-container {
flex: 1 1 auto;
width: 100%;
height: 100%;
}

mat-sidenav {
width: 200px;
}

.app-content {
min-height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
}




55 changes: 55 additions & 0 deletions src/app/operators/_operator-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@import '~@angular/material/theming';

$operator-border: #f3f3f3;
$operator-active: #62757f;
$link-color: #2196F3;

@mixin operator-theme($theme) {
$primary: mat-color(map-get($theme, primary));
$accent: mat-color(map-get($theme, accent));
$operator-active-background: rgba($operator-active, .7);

rx-marbles > div {
text-align: center;
min-width: 840px;

circle {
// temp fix: current broken on marble component
filter: none !important;
}
}

app-operator a {
text-decoration: none;
color: $link-color;
}

.operator-list {
a {
border-bottom: 1px solid $operator-border;
&.active-operator {
background-color: $operator-border;
// color: white;
&:hover {
background-color: $operator-border;
}
}
&:last-child {
border-bottom: none;
}
}
}

.section-list {
padding: 1px;
list-style-type: none;
margin-top: 0;

li {
padding-bottom: 5px;
&:last-child {
padding-bottom: 0;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h2> Additional Resources </h2>
<ul class="section-list">
<li>
<a [href]="sourceUrl" target="_blank"> Source Code </a>
</li>
<li>
<a [href]="specsUrl" target="_blank"> Specs </a>
</li>
<li *ngFor="let resource of additionalResources">
<a [href]="resource.url" target="_blank"> {{ resource.description }} </a>
</li>
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component, Input } from '@angular/core';
import { OperatorReference } from '../../../../operator-docs';

@Component({
selector: 'app-additional-resources',
templateUrl: './additional-resources.component.html',
styleUrls: ['./additional-resources.component.scss']
})
export class AdditionalResourcesComponent {
@Input() additionalResources: OperatorReference[];
@Input() sourceUrl: string;
@Input() specsUrl: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div
*ngIf="!useInteractiveMarbles"
class="marble-wrapper mat-elevation-z2">
<img class="marble-diagram" [src]="url" *ngIf="url"/>
</div>
<rx-marbles
*ngIf="useInteractiveMarbles"
[attr.key]="operatorName">
</rx-marbles>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import '../../../../styles/media-helpers';

.marble-wrapper {
background-color: white;
text-align: center;
}

.marble-diagram {
max-width: 640px;

@media #{$mat-sm-down} {
max-width: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component, Input } from '@angular/core';
import { OperatorParameters } from '../../../../operator-docs';

@Component({
selector: 'app-marble-diagram',
templateUrl: './marble-diagram.component.html',
styleUrls: ['./marble-diagram.component.scss']
})
export class MarbleDiagramComponent {
@Input() operatorName: string;
@Input() useInteractiveMarbles: boolean;
@Input() url: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<h2> Examples </h2>
<div
class="code-example"
*ngFor="let example of operatorExamples"
appHighlightJs>
<div class="code-block mat-elevation-z2">
<div class="example-header">
<div class="header-title" [innerHTML]="example.name"></div>
<button
mat-icon-button
ngxClipboard
[cbContent]="example.code"
matTooltip="Copy">
<mat-icon>content_copy</mat-icon>
</button>
</div>
<div class="bin-wrapper">
<iframe [src]="example.externalLink.url | safeUrl"></iframe>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.code-block {
position: relative;

pre {
margin-top: 0;
padding-top: 0;
}
}

.menu-button {
position: absolute;
right: 0;
top: 0;
}

.example-options {
position: absolute;
top: 0;
right: 0;
}

.example-header {
align-content: center;
align-items: center;
display: flex;
justify-content: center;
padding: 8px 6px 8px 18px;
color: rgba(0, 0, 0, 0.692);
background: #fafafa;

.header-title {
flex: 1 1 auto;
}
}

.bin-wrapper {
iframe {
border: none;
width:100%;
height: 350px;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
import { OperatorExample } from '../../../../operator-docs';

@Component({
selector: 'app-operator-examples',
templateUrl: './operator-examples.component.html',
styleUrls: ['./operator-examples.component.scss']
})
export class OperatorExamplesComponent {
@Input() operatorExamples: OperatorExample[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div
class="extra-tip"
*ngFor="let tip of tips">
<mat-icon class="tip-info">info</mat-icon>
<h3 [innerHTML]="tip.text"></h3>
</div>
<div
class="extra-tip"
*ngFor="let warning of warnings">
<mat-icon class="tip-warning">warning</mat-icon>
<h3 [innerHTML]="warning.text"></h3>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
h3 {
display: inline-block;
vertical-align: middle;
padding-left: 10px;
}

.tip-warning {
color: rgb(244, 67, 54);
}

.tip-info {
color: rgb(33, 150, 243);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, Input } from '@angular/core';
import { OperatorExtra } from '../../../../operator-docs';

@Component({
selector: 'app-operator-extras',
templateUrl: './operator-extras.component.html',
styleUrls: ['./operator-extras.component.scss']
})
export class OperatorExtrasComponent {
@Input() operatorExtras: OperatorExtra[] = [];

get tips() {
return this.operatorExtras.filter(e => e.type === 'Tip');
}

get warnings() {
return this.operatorExtras.filter(e => e.type === 'Warning');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<mat-toolbar class="operator-name">
{{ operatorName }}
</mat-toolbar>
<mat-toolbar class="signature">
{{ operatorSignature }}
</mat-toolbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import '../../operator-theme';

.operator-name {
font-size:30px;
}

.signature {
margin-bottom: 24px;
}

mat-toolbar {
background: $operator-active !important;
color: rgba(255, 255, 255, 0.87);
font-weight: normal;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';

@Component({
selector: 'app-operator-header',
templateUrl: './operator-header.component.html',
styleUrls: ['./operator-header.component.scss']
})
export class OperatorHeaderComponent {
@Input() operatorName: string;
@Input() operatorSignature: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h2> Parameters </h2>
<table class="parameter-table mat-elevation-z2">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let parameter of operatorParameters">
<td> {{parameter.name}} </td>
<td> {{parameter.type}} </td>
<td> {{parameter.attribute}} </td>
<td> {{parameter.description}} </td>
</tr>
</tbody>
</table>
Loading