View FractionType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BasicMathType } from "./basic-math-type"; | |
// Fraction Type | |
export interface FractionType extends BasicMathType | |
{ | |
// is this a mixed number? | |
get mixed(): boolean | |
// designate this as a mixed number | |
set mixed(pIsMixed: boolean); |
View BasicMathType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type ExtendedMathType = | |
BasicMathType | | |
number | | |
string; | |
import { MathTypeEnum } from "./math-type-enum"; | |
export interface BasicMathType | |
{ | |
// what is the current math type? |
View evalute.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public evaluate(variables: Array<expressionOperand>): expressionValue | |
{ | |
if (this._expressionStack.length === 0) return false; | |
if (variables.length != this._variables.length) return false; | |
const len: number = variables.length; | |
let j: number; | |
for (j = 0; j < len; ++j) { | |
if (!this.__isValidOperand(variables[j])) return false; |
View state-machine-models.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The current state of a machine with a given name | |
*/ | |
export interface FSMState | |
{ | |
name: string; | |
isAcceptance: boolean; | |
transition: string; |
View setPreviewImage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public setPreviewImage(imgURL: string): void | |
{ | |
if (this._canvas !== undefined) | |
{ | |
const img: HTMLImageElement = new Image(); | |
this._url = imgURL; | |
img.crossOrigin = 'anonymous'; | |
// TODO This only works for a single image load. As an exercise, modify to handle deletion (including handlers) |
View fabric-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { fabric } from 'fabric'; | |
import { POINT } from '../libs/point'; | |
@Injectable({providedIn: 'root'}) | |
export class FabricService | |
{ | |
// draw properties are public to keep the demo more compact; but, you break it ... you buy it |
View basic-legend.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
MapLegendClasses, | |
MapLegendData, | |
LegendMainHeading | |
} from './map-legends'; | |
export const legendClasses: MapLegendClasses = | |
{ | |
legendTitleClass: "title-text", |
View map-legend.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type IconProps = LegendCircleData | LegendRectData | LegendPolygonData; | |
export interface MapLegendClasses | |
{ | |
legendTitleClass: string; | |
legendContainerClass: Array<string>; | |
legendHeadingClass: string; |
View calculator.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createReducer, | |
on, | |
createSelector, | |
createFeatureSelector | |
} from '@ngrx/store'; | |
import * as CalculatorActions from './calculator.actions'; | |
import { QCalc } from '../../shared/definitions/QCalc'; |
View QCalulations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { TSMT$Quaternion } from './Quaternion'; | |
import { Q } from '../definitions/Q'; | |
export class QCalculations | |
{ | |
protected static readonly Q1: TSMT$Quaternion = new TSMT$Quaternion(); | |
protected static readonly Q2: TSMT$Quaternion = new TSMT$Quaternion(); | |
constructor() | |
{ |
NewerOlder