Skip to content
Snippets Groups Projects
Commit fb9bfd01 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

cleanup

parent 4d015d7c
No related branches found
No related tags found
1 merge request!1Disagg Plotter
...@@ -2,3 +2,14 @@ ...@@ -2,3 +2,14 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.calling {
height: 100%;
width: 100%;
p {
position: absolute;
left: 50%;
top: 50%;
}
}
import { Component, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core'; import { Component, ViewChild, ElementRef, OnInit, AfterViewInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { DisaggResponse, Disaggregation, DisaggGraphView } from '@nshmp/disagg-d3/src/disagg'; import { DisaggResponse, Disaggregation, DisaggGraphView } from '@nshmp/disagg-d3/src/disagg';
import { Collection } from '@nshmp/disagg-d3/src/mvc'; import { Collection } from '@nshmp/disagg-d3/src/mvc';
import { DeaggResponseData } from '@nshmp/nshmp-utils/nshmp';
import { AppService } from './app.service'; import * as deagg from '../assets/deagg.json';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'], styleUrls: ['./app.component.scss'],
}) })
export class AppComponent implements AfterViewInit, OnDestroy { export class AppComponent implements AfterViewInit {
title = 'example'; title = 'Disaggregation';
data = (deagg.response.pop() as any) as DeaggResponseData;
@ViewChild('example') @ViewChild('example')
el: ElementRef<HTMLElement>; el: ElementRef<HTMLElement>;
sub: Subscription; constructor() {}
constructor(private service: AppService) {}
ngAfterViewInit(): void { ngAfterViewInit(): void {
this.sub = this.service.callDeagg$.subscribe((usageResponse) => { const response = new DisaggResponse(this.data);
const response = new DisaggResponse(usageResponse.response.pop()); const deaggs = response.get<Collection<Disaggregation>>('disaggregations').data();
const deaggs = response.get<Collection<Disaggregation>>('disaggregations').data(); const collection = new Collection(deaggs);
const collection = new Collection(deaggs); collection.select(collection.data()[0]);
collection.select(collection.data()[0]);
const view = new DisaggGraphView({
const view = new DisaggGraphView({ el: this.el.nativeElement,
el: this.el.nativeElement, collection,
collection,
});
}); });
} }
ngOnDestroy(): void {
this.sub.unsubscribe();
}
} }
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
imports: [BrowserModule, HttpClientModule], imports: [BrowserModule],
providers: [], providers: [],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/* You can add global styles to this file, and also import other style files */
@import '~node_modules/@nshmp/disagg-d3/styles/disagg-d3.scss'; @import '~node_modules/@nshmp/disagg-d3/styles/disagg-d3.scss';
svg {
border: 1px solid #ccc;
shape-rendering: auto;
}
path {
stroke: #000;
stroke-width: 1;
}
// text {
// fill: #999;
// }
// .side-x0 {
// fill: #900;
// }
// .side-x1 {
// fill: #f00;
// }
// .side-y0 {
// fill: #090;
// }
// .side-y1 {
// fill: #0f0;
// }
// .side-z0 {
// fill: #009;
// }
// .side-z1 {
// fill: #00f;
// }
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"moduleResolution": "node", "moduleResolution": "node",
"importHelpers": true, "importHelpers": true,
"resolveJsonModule": true,
"target": "es2015", "target": "es2015",
"module": "es2020", "module": "es2020",
"lib": ["es2018", "dom"] "lib": ["es2018", "dom"]
......
...@@ -41,14 +41,6 @@ export class Collection<T> extends Events { ...@@ -41,14 +41,6 @@ export class Collection<T> extends Events {
*/ */
deselect(options: CollectionOptions): void; deselect(options: CollectionOptions): void;
/**
* Free the array and id cache.
*
* @param options
* passed to #deselect().
*/
destroy(options: CollectionOptions): void;
/** /**
* Get an object in the collection by ID. * Get an object in the collection by ID.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment