# HG changeset patch # User Lucas Thompson # Date 1500653531 -3600 # Node ID f3a8e2284a87fad51f838c667ed589fafe0ab3a1 # Parent 7253d73ac7c90f5bb146764d5a2ba522ec73f6f9 Remove console log and tighten object member check. diff -r 7253d73ac7c9 -r f3a8e2284a87 src/app/visualisations/FeatureUtilities.ts --- a/src/app/visualisations/FeatureUtilities.ts Fri Jul 21 16:22:51 2017 +0100 +++ b/src/app/visualisations/FeatureUtilities.ts Fri Jul 21 17:12:11 2017 +0100 @@ -129,14 +129,14 @@ const rdfTypes = { 'http://purl.org/ontology/af/Note': 'notes', -// 'http://purl.org/ontology/af/StructuralSegment': 'segments' -} +// 'http://purl.org/ontology/af/StructuralSegment': 'segments' // TODO segments +}; const throwShapeError = () => { throw new Error('No shape could be deduced'); }; function deduceHigherLevelFeatureShape(response: SimpleResponse) : HigherLevelFeatureShape { - + const collection = response.features; const descriptor = response.outputDescriptor; if (hasKnownShapeOtherThanList(collection.shape)) { @@ -163,19 +163,17 @@ if (descriptor.static) { const typeURI = descriptor.static.typeURI; - if (typeURI && - typeURI !== "" && - typeof (rdfTypes[typeURI]) !== 'undefined') { + if (typeof typeURI === 'string' && typeof rdfTypes[typeURI] === 'string') { return rdfTypes[typeURI]; } } const isRegionLike = hasDuration && (featureData.length > 0 && featureData[0].timestamp != null); - + const isMaybeNote = getCanonicalNoteLikeUnit(descriptor.configured.unit) && [1, 2].find(nBins => nBins === binCount); - + if (isRegionLike) { if (isMaybeNote) { return 'notes'; @@ -183,7 +181,7 @@ return 'regions'; } } - + throwShapeError(); } @@ -269,8 +267,6 @@ max = 1; } - console.log("range min = " + min + ", max = " + max); - return { data: winnowed.map(feature => { let duration = 0;