diff --git a/auspice.js b/auspice.js index 4a7b28f44..6b352c44b 100755 --- a/auspice.js +++ b/auspice.js @@ -15,7 +15,7 @@ const parser = new argparse.ArgumentParser({ Auspice is an interactive visualisation tool for phylogenomic data. It can be used to display local datasets (see "auspice view -h" for details), or to build a customised version of the software (see "auspice build -h" for details). - This is the software which powers the visualisations on nextstrain.org and auspice.us, amoung others. + This is the software which powers the visualisations on nextstrain.org and auspice.us, among others. ` }); diff --git a/src/actions/filesDropped/parseCsv.js b/src/actions/filesDropped/parseCsv.js index b440420a7..d358a476d 100644 --- a/src/actions/filesDropped/parseCsv.js +++ b/src/actions/filesDropped/parseCsv.js @@ -3,7 +3,7 @@ let Papa; /* lazyily imported once a file is dropped on */ /** * A promise-ified version of Papa.parse() * A note on encoding here: It will be common that people drop CSVs from microsoft excel - * in here annd, you guessed it, this causes all sorts of problems. + * in here and, you guessed it, this causes all sorts of problems. * https://github.com/mholt/PapaParse/issues/169 suggests adding encoding: "ISO-8859-1" * to the config, which may work * @param {string} csvString a string of delimited text diff --git a/src/actions/recomputeReduxState.js b/src/actions/recomputeReduxState.js index ecefe85f2..cdda54227 100644 --- a/src/actions/recomputeReduxState.js +++ b/src/actions/recomputeReduxState.js @@ -253,7 +253,7 @@ const modifyStateViaMetadata = (state, metadata) => { console.error("Skipping 'display_default' for sidebar as it's not 'open' or 'closed'"); } } else { - /* most of the time if key=geoResoltion, set both state.geoResolution and state.defaults.geoResolution */ + /* most of the time if key=geoResolution, set both state.geoResolution and state.defaults.geoResolution */ state[keysToCheckFor[i]] = metadata.displayDefaults[keysToCheckFor[i]]; state.defaults[keysToCheckFor[i]] = metadata.displayDefaults[keysToCheckFor[i]]; } @@ -491,7 +491,7 @@ const checkAndCorrectErrorsInState = (state, metadata, query, tree, viewingNarra if (metadata.geoResolutions) { const availableGeoResultions = metadata.geoResolutions.map((i) => i.key); if (availableGeoResultions.indexOf(state["geoResolution"]) === -1) { - /* fallbacks: JSON defined default, then hardocded default, then any available */ + /* fallbacks: JSON defined default, then hardcoded default, then any available */ if (metadata.displayDefaults && metadata.displayDefaults.geoResolution && availableGeoResultions.indexOf(metadata.displayDefaults.geoResolution) !== -1) { state.geoResolution = metadata.displayDefaults.geoResolution; } else if (availableGeoResultions.indexOf(defaultGeoResolution) !== -1) { @@ -616,7 +616,7 @@ const modifyTreeStateVisAndBranchThickness = (oldState, zoomSelected, controlsSt newIdxRoot = applyInViewNodesToTree(0, oldState); } - /* calculate new branch thickesses & visibility, as this depends on the root note */ + /* calculate new branch thicknesses & visibility, as this depends on the root note */ const visAndThicknessData = calculateVisiblityAndBranchThickness( oldState, controlsState, @@ -922,7 +922,7 @@ export const createTreeTooState = ({ secondTreeUrl, /* treeToo URL */ dispatch }) => { - /* TODO: reconsile choices (filters, colorBys etc) with this new tree */ + /* TODO: reconcile choices (filters, colorBys etc) with this new tree */ /* TODO: reconcile query with visibility etc */ let controls = oldState.controls; const tree = Object.assign({}, oldState.tree); diff --git a/src/actions/tree.js b/src/actions/tree.js index 2aee1542b..498588ed7 100644 --- a/src/actions/tree.js +++ b/src/actions/tree.js @@ -142,7 +142,7 @@ export const updateVisibleTipsAndBranchThicknesses = ( /** * date changes need to update tip visibility & branch thicknesses * this can be done in a single action - * NB calling this without specifing newMin OR newMax is a no-op + * NB calling this without specifying newMin OR newMax is a no-op * @param {string|false} newMin optional * @param {string|false} newMax optional * @return {null} side-effects: a single action @@ -333,7 +333,7 @@ const _traverseAndCreateSubtrees = (root, node, attr) => { // store original children so we traverse the entire tree const originalChildren = node.hasChildren ? [...node.children] : []; - if (node.arrayIdx === 0) { // __ROOT will hold all (expoded) subtrees + if (node.arrayIdx === 0) { // __ROOT will hold all (exploded) subtrees node.unexplodedChildren = originalChildren; } else if (node.hasChildren) { const parentTrait = getTraitFromNode(node, attr); diff --git a/src/components/datasetLoader/index.js b/src/components/datasetLoader/index.js index 9ab616d90..5af1ed4e4 100644 --- a/src/components/datasetLoader/index.js +++ b/src/components/datasetLoader/index.js @@ -3,7 +3,7 @@ import { connect } from "react-redux"; import { loadJSONs } from "../../actions/loadData"; import { PAGE_CHANGE } from "../../actions/types"; -/* The DatsetLoader component simply triggers the (async) loadJSONs action +/* The DatasetLoader component simply triggers the (async) loadJSONs action * and then redirects to the "main" page (via a PAGE_CHANGE action). * Note that if the loadJSONs action "fails" it will subsequently redirect to a 404 page */ diff --git a/src/components/download/helperFunctions.js b/src/components/download/helperFunctions.js index d586d8695..42043de3e 100644 --- a/src/components/download/helperFunctions.js +++ b/src/components/download/helperFunctions.js @@ -131,7 +131,7 @@ export const areAuthorsPresent = (tree) => { /** * Create & write a TSV file where each row is an author, - * with the relevent information (num isolates, journal etcetera) + * with the relevant information (num isolates, journal etcetera) */ export const authorTSV = (dispatch, filePrefix, tree) => { const lineArray = []; @@ -170,7 +170,7 @@ export const authorTSV = (dispatch, filePrefix, tree) => { /** * Create & write a TSV file where each row is a strain in the tree, - * with the relevent information (accession, traits, etcetera). + * with the relevant information (accession, traits, etcetera). * Only visible nodes (tips) will be included in the file. */ export const strainTSV = (dispatch, filePrefix, nodes, colorings, nodeVisibilities) => { @@ -205,7 +205,7 @@ export const strainTSV = (dispatch, filePrefix, nodes, colorings, nodeVisibiliti } /* collect values (as writable strings) of the same "traits" as can be viewed by the modal displayed - when clicking on tips. Note that "num_date", "author" and "vaccine" are considered seperately below */ + when clicking on tips. Note that "num_date", "author" and "vaccine" are considered separately below */ const nodeAttrsToIgnore = ["author", "div", "num_date", "vaccine", "accession"]; const traits = Object.keys(node.node_attrs).filter((k) => !nodeAttrsToIgnore.includes(k)); for (const trait of traits) { @@ -455,7 +455,7 @@ const injectAsSVGStrings = (output, key, data) => { output.push(""); }; -/* define actual writer as a closure, because it may need to be triggered asyncronously */ +/* define actual writer as a closure, because it may need to be triggered asynchronously */ const writeSVGPossiblyIncludingMap = (dispatch, filePrefix, panelsInDOM, panelLayout, textStrings, map) => { const errors = []; /* for each panel present in the DOM, create a data structure with the dimensions & the paths/shapes etc */ diff --git a/src/components/entropy/entropyD3.js b/src/components/entropy/entropyD3.js index 3a13b679a..1e2305a1e 100644 --- a/src/components/entropy/entropyD3.js +++ b/src/components/entropy/entropyD3.js @@ -38,7 +38,7 @@ EntropyChart.prototype.render = function render(props) { this._drawMainNavElements(); this._addZoomLayers(); this._setScales(this.maxNt + 1, props.maxYVal); - /* If only a gene/nuc, zoom to that. If zoom min/max as well, that takes precidence */ + /* If only a gene/nuc, zoom to that. If zoom min/max as well, that takes precedence */ this.zoomCoordinates = isColorByGenotype(props.colorBy) ? this._getZoomCoordinates(decodeColorByGenotype(props.colorBy, props.geneLength), props.geneMap) : this.scales.xNav.domain(); // []; /* set zoom to specified gene or to whole genome */ @@ -466,7 +466,7 @@ EntropyChart.prototype._addBrush = function _addBrush() { return d3Event && d3Event.sourceEvent && d3Event.sourceEvent.type === 'zoom'; } - /* zooms in by modifing the domain of xMain scale */ + /* zooms in by modifying the domain of xMain scale */ this._zoom = function _zoom(start, end) { const s = [start, end]; this.scales.xMain.domain(s); diff --git a/src/components/entropy/index.js b/src/components/entropy/index.js index 8f477cafa..67345948d 100644 --- a/src/components/entropy/index.js +++ b/src/components/entropy/index.js @@ -111,7 +111,7 @@ class Entropy extends React.Component { if (newMutType !== this.props.mutType) { /* 1. switch the redux colorBy back to the default */ this.props.dispatch(changeColorBy(this.props.defaultColorBy)); - /* 2. update the mut type in redux & re-calulate entropy */ + /* 2. update the mut type in redux & re-calculate entropy */ this.props.dispatch(changeMutType(newMutType)); } } diff --git a/src/components/framework/footer.js b/src/components/framework/footer.js index f47134383..d1f350442 100644 --- a/src/components/framework/footer.js +++ b/src/components/framework/footer.js @@ -156,8 +156,8 @@ const FooterStyles = styled.div` export const getAcknowledgments = (metadata, dispatch) => { /** - * If the metadata contains a description key, then it will take precendence the hard-coded - * acknowledgements. Expects the text in the description to be in Mardown format. + * If the metadata contains a description key, then it will take precedence the hard-coded + * acknowledgements. Expects the text in the description to be in Markdown format. * Jover. December 2019. */ if (metadata.description) { diff --git a/src/components/main/index.js b/src/components/main/index.js index ece9b80cc..4d60de808 100644 --- a/src/components/main/index.js +++ b/src/components/main/index.js @@ -48,7 +48,7 @@ const Measurements = lazy(() => import("../measurements")); class Main extends React.Component { constructor(props) { super(props); - /* window listner employed to toggle switch to mobile display. + /* window listener employed to toggle switch to mobile display. NOTE: this used to toggle sidebar open boolean when that was stored as state here, but his has since ben moved to redux state. The mobile display should likewise be lifted to redux state */ diff --git a/src/components/main/utils.js b/src/components/main/utils.js index 7a42ef104..67763012c 100644 --- a/src/components/main/utils.js +++ b/src/components/main/utils.js @@ -3,7 +3,7 @@ import { controlsWidth, controlsPadding } from "../../util/globals"; export const calcPanelDims = (panels, narrativeIsDisplayed, availableWidth, availableHeight) => { - /* Calculate reponsive geometries. chart: entropy, frequencies. full/grid: map, tree, measurements */ + /* Calculate responsive geometries. chart: entropy, frequencies. full/grid: map, tree, measurements */ const chartWidthFraction = 1; const fullWidthFraction = 1; const gridWidthFraction = 0.5; diff --git a/src/components/map/map.js b/src/components/map/map.js index d28a01f39..070e950d9 100644 --- a/src/components/map/map.js +++ b/src/components/map/map.js @@ -244,7 +244,7 @@ class Map extends React.Component { this.props.showTransmissionLines, ); - // don't redraw on every rerender - need to seperately handle virus change redraw + // don't redraw on every rerender - need to separately handle virus change redraw this.setState({ boundsSet: true, d3elems, @@ -296,7 +296,7 @@ class Map extends React.Component { if (!this.state.demeData || !this.state.transmissionData) { /* this seems to happen when the data takes a particularly long time to create. - and the map is ready before the data (??). It's imperitive that this method runs + and the map is ready before the data (??). It's imperative that this method runs so if the data's not ready yet we try to rerun it after a short time. This could be improved */ window.setTimeout(() => this.respondToLeafletEvent(leafletEvent), 50); @@ -358,7 +358,7 @@ class Map extends React.Component { /** * updates demes & transmissions when redux (tree) visibility or colorScale (i.e. colorBy) has changed * returns early if the map or tree isn't ready - * uses deme & transmission indicies for smart (quick) updating + * uses deme & transmission indices for smart (quick) updating */ maybeUpdateDemesAndTransmissions(nextProps) { if (!this.state.map || !this.props.treeLoaded || !this.state.d3elems) { return; } diff --git a/src/components/map/mapHelpersLatLong.js b/src/components/map/mapHelpersLatLong.js index 8a213e18b..09abe4b51 100644 --- a/src/components/map/mapHelpersLatLong.js +++ b/src/components/map/mapHelpersLatLong.js @@ -146,7 +146,7 @@ const setupDemeData = (nodes, visibility, geoResolution, nodeColors, triplicate, const coords = leafletLatLongToLayerPoint(lat, long, map); /* add entries to - * (1) `demeIndicies` -- a dict of "deme value" to the indicies of `demeData` & `arcData` where they appear + * (1) `demeIndices` -- a dict of "deme value" to the indices of `demeData` & `arcData` where they appear * (2) `demeData` -- an array of objects, each with {name, count etc.} * if pie charts, then `demeData.arcs` exists, if colour-blended circles, `demeData.color` exists */ diff --git a/src/components/measurements/index.js b/src/components/measurements/index.js index 2e647bfbc..1e8aec4eb 100644 --- a/src/components/measurements/index.js +++ b/src/components/measurements/index.js @@ -48,7 +48,7 @@ const isVisible = (visibility) => visibility === NODE_VISIBLE; * are relevant for the Measurement's panel. Uses the colorScale redux state to * find the current color attribute per strain. * - * tree.visiblity and tree.nodeColors need to be an arrays that have the same + * tree.visibility and tree.nodeColors need to be arrays that have the same * order as tree.nodes * @param {Object} state * @returns {Object} diff --git a/src/components/measurements/measurementsD3.js b/src/components/measurements/measurementsD3.js index 0ce5e32ca..91829dbc4 100644 --- a/src/components/measurements/measurementsD3.js +++ b/src/components/measurements/measurementsD3.js @@ -187,7 +187,7 @@ export const drawMeasurementsSVG = (ref, svgData) => { // Create a subplot for each grouping let prevSubplotBottom = layout.topPadding; groupedMeasurements.forEach(([groupingValue, measurements], index) => { - // Make each subplot it's own SVG to re-use the same subplot yScale + // Make each subplot its own SVG to re-use the same subplot yScale const subplot = svg.append("svg") .attr("class", classes.subplot) .attr("id", getSubplotDOMId(groupingOrderedValues.indexOf(groupingValue))) @@ -222,7 +222,7 @@ export const drawMeasurementsSVG = (ref, svgData) => { // If necessary, scale down the text to fit in the available space for the y-Axis labels // This does mean that if the text is extremely long, it can be unreadable. // We can improve on this by manually splitting the text into parts that can fit on multiple lines, - // but there's always limits of the available space so punting that for now. + // but there're always limits of the available space so punting that for now. // -Jover, 20 September 2022 g.selectAll('text') .attr("transform", (_, i, element) => { @@ -283,7 +283,7 @@ export const colorMeasurementsSVG = (ref, treeStrainColors) => { export const drawMeansForColorBy = (ref, svgData, treeStrainColors, legendValues) => { const { xScale, groupingOrderedValues, groupedMeasurements } = svgData; const svg = select(ref); - // Re move all current color by means + // Remove all current color by means svg.selectAll(`.${classes.colorMean}`).remove(); // Calc and draw color by means for each group groupedMeasurements.forEach(([groupingValue, measurements]) => { diff --git a/src/components/narrative/MainDisplayMarkdown.js b/src/components/narrative/MainDisplayMarkdown.js index eca153a83..cc8870021 100644 --- a/src/components/narrative/MainDisplayMarkdown.js +++ b/src/components/narrative/MainDisplayMarkdown.js @@ -8,8 +8,8 @@ const MarkdownDisplay = lazy(() => import("../markdownDisplay")); /** * The following code borrows heavily from the Footer * but is here in order to allow modifications with no side - * effects to the Footer. This work was done in an expidited fashion - * for nCoV but this should be revisted and improved when we have + * effects to the Footer. This work was done in an expedited fashion + * for nCoV but this should be revisited and improved when we have * time. james. Jan 24 2020 */ diff --git a/src/components/narrative/MobileNarrativeDisplay.js b/src/components/narrative/MobileNarrativeDisplay.js index b335a7a47..16a3c1b4d 100644 --- a/src/components/narrative/MobileNarrativeDisplay.js +++ b/src/components/narrative/MobileNarrativeDisplay.js @@ -28,7 +28,7 @@ const scrollToTop = () => { const explanationParagraph=`

- Narratives are interleaved sections of text and associated nextstrain visualisations of the genomic data. + Narratives are interleaved sections of text and associated Nextstrain visualisations of the genomic data. Click the coloured arrows at the top & bottom of each page to move through this narrative. Within each page, you can scroll through the text to see visualisations of the genomic data.

@@ -79,7 +79,7 @@ class MobileNarrativeDisplay extends React.Component { )); scrollToTop(); }; - // TODO: bind down & up arrows (is this ok since we also have scollable content?) + // TODO: bind down & up arrows (is this ok since we also have scrollable content?) } pageNarrativeContent() { diff --git a/src/components/narrative/index.js b/src/components/narrative/index.js index aa4984879..9dc28e573 100644 --- a/src/components/narrative/index.js +++ b/src/components/narrative/index.js @@ -63,7 +63,7 @@ class Narrative extends React.Component { this.reactPageScroller.goToPage(this.props.currentInFocusBlockIdx); } /* bind arrow keys to move around in narrative */ - /* Note that "normal" page scrolling is not avaialble in narrative mode + /* Note that "normal" page scrolling is not available in narrative mode and that scrolling the sidebar is associated with changing the narrative slide */ Mousetrap.bind(['left', 'up'], this.goToPreviousSlide); Mousetrap.bind(['right', 'down'], this.goToNextSlide); diff --git a/src/components/narrativeEditor/markdownInput.js b/src/components/narrativeEditor/markdownInput.js index 7cc189c89..fa449333c 100644 --- a/src/components/narrativeEditor/markdownInput.js +++ b/src/components/narrativeEditor/markdownInput.js @@ -96,7 +96,7 @@ export const MarkdownInput = ({fileName, setNarrative, setError}) => { /** promisify FileReader's readAsText() so we can use it within * async functions via `await readJson(file)`. - * Originally addapted from https://stackoverflow.com/a/51026615 + * Originally adapted from https://stackoverflow.com/a/51026615 * Taken from https://github.com/nextstrain/auspice.us/blob/427c138dcfce1f0e6fff8049dacc4e416304ff7a/auspice_client_customisation/handleDroppedFiles.js#L24-L44 */ function readFile(file, isJSON=true) { diff --git a/src/components/tree/legend/legend.js b/src/components/tree/legend/legend.js index 6e3e169ca..c2554c62a 100644 --- a/src/components/tree/legend/legend.js +++ b/src/components/tree/legend/legend.js @@ -213,7 +213,7 @@ class Legend extends React.Component { } render() { - // catch the case where we try to render before anythings ready + // catch the case where we try to render before anything's ready if (!this.props.colorScale) return null; return ( { } /* how many of those "units" should ideally fit into each major grid separation? */ majorStep.n = Math.floor(timeBetweenMajorGrids/levels[majorStep.unit].t) || 1; - /* if the numer of units (per major grid) is above the allowed max, use a bigger unit */ + /* if the number of units (per major grid) is above the allowed max, use a bigger unit */ if (levels[majorStep.unit].max && majorStep.n > levels[majorStep.unit].max) { majorStep.unit = levelsKeys[levelsKeys.indexOf(majorStep.unit)-1]; majorStep.n = Math.floor(timeBetweenMajorGrids/levels[majorStep.unit].t) || 1; diff --git a/src/components/tree/phyloTree/helpers.js b/src/components/tree/phyloTree/helpers.js index 29e55016a..899f69842 100644 --- a/src/components/tree/phyloTree/helpers.js +++ b/src/components/tree/phyloTree/helpers.js @@ -48,7 +48,7 @@ export const setDisplayOrderRecursively = (node, yCounter) => { node.displayOrderRange = [yCounter, yCounter]; return yCounter; } - /* if here, then all children have displayOrders, but we dont. */ + /* if here, then all children have displayOrders, but we don't. */ node.displayOrder = children.reduce((acc, d) => acc + d.shell.displayOrder, 0) / children.length; node.displayOrderRange = [children[0].shell.displayOrder, children[children.length - 1].shell.displayOrder]; return yCounter; diff --git a/src/components/tree/phyloTree/layouts.js b/src/components/tree/phyloTree/layouts.js index 23c59cbd5..916399e66 100644 --- a/src/components/tree/phyloTree/layouts.js +++ b/src/components/tree/phyloTree/layouts.js @@ -50,7 +50,7 @@ export const setLayout = function setLayout(layout, scatterVariables) { }; /** - * assignes x,y coordinates for a rectancular layout + * assignes x,y coordinates for a rectangular layout * @return {null} */ export const rectangularLayout = function rectangularLayout() { diff --git a/src/components/tree/reactD3Interface/change.js b/src/components/tree/reactD3Interface/change.js index cc5c72d35..4ff6f57ec 100644 --- a/src/components/tree/reactD3Interface/change.js +++ b/src/components/tree/reactD3Interface/change.js @@ -11,7 +11,7 @@ export const changePhyloTreeViaPropsComparison = (mainTree, phylotree, oldProps, Note that updating properties itself won't trigger any visual changes */ phylotree.dateRange = [newProps.dateMinNumeric, newProps.dateMaxNumeric]; - /* catch selectedStrain dissapearence seperately to visibility and remove modal */ + /* catch selectedStrain disappearance separately to visibility and remove modal */ if (oldTreeRedux.selectedStrain && !newTreeRedux.selectedStrain) { /* TODO change back the tip radius */ newState.selectedNode = {}; diff --git a/src/components/tree/reactD3Interface/initialRender.js b/src/components/tree/reactD3Interface/initialRender.js index 3ee32a1cd..880fd87c9 100644 --- a/src/components/tree/reactD3Interface/initialRender.js +++ b/src/components/tree/reactD3Interface/initialRender.js @@ -39,7 +39,7 @@ export const renderTree = (that, main, phylotree, props) => { onTipLeave: callbacks.onTipLeave.bind(that), tipLabel: makeTipLabelFunc(props.tipLabelKey) }, - treeState.branchThickness, /* guarenteed to be in redux by now */ + treeState.branchThickness, /* guaranteed to be in redux by now */ treeState.visibility, props.temporalConfidence.on, /* drawConfidence? */ treeState.vaccines, diff --git a/src/components/tree/tangle/unusedUntanglingCode.js b/src/components/tree/tangle/unusedUntanglingCode.js index ddbe4605d..70fb3c74f 100644 --- a/src/components/tree/tangle/unusedUntanglingCode.js +++ b/src/components/tree/tangle/unusedUntanglingCode.js @@ -1,6 +1,6 @@ /** applyToNodesPostOrder - * recursivly apply the callback to each node postorder (root to tip, go left as far as you can, then backtrack...) + * recursively apply the callback to each node postorder (root to tip, go left as far as you can, then backtrack...) */ // const applyToNodesPostOrder = (node, callback) => { // if (node.children) { diff --git a/src/components/tree/tree.js b/src/components/tree/tree.js index a5d67bb13..4c4e86b8b 100644 --- a/src/components/tree/tree.js +++ b/src/components/tree/tree.js @@ -67,7 +67,7 @@ class Tree extends React.Component { this.setUpAndRenderTreeToo(this.props, newState); /* modifies newState in place */ } newState.geneSortFn = sortByGeneOrder(this.props.metadata.genomeAnnotations); - this.setState(newState); /* this will trigger an unneccessary CDU :( */ + this.setState(newState); /* this will trigger an unnecessary CDU :( */ } } componentDidUpdate(prevProps) { @@ -96,7 +96,7 @@ class Tree extends React.Component { /* note, we don't incorporate unusedNewState into the state? why not? */ } - /* we may need to (imperitively) tell the tangle to redraw */ + /* we may need to (imperatively) tell the tangle to redraw */ if (this.tangleRef && (leftTreeUpdated || rightTreeUpdated)) { this.tangleRef.drawLines(); } diff --git a/src/reducers/metadata.js b/src/reducers/metadata.js index bcfc4a7da..73262dbea 100644 --- a/src/reducers/metadata.js +++ b/src/reducers/metadata.js @@ -1,7 +1,7 @@ import { colorOptions } from "../util/globals"; import * as types from "../actions/types"; -/* The metdata reducer holds data that is +/* The metadata reducer holds data that is * (a) mostly derived from the dataset JSON * (b) rarely changes */ diff --git a/src/reducers/tree.js b/src/reducers/tree.js index 23bb88202..eb1ed6d74 100644 --- a/src/reducers/tree.js +++ b/src/reducers/tree.js @@ -40,8 +40,8 @@ const Tree = (state = getDefaultTreeState(), action) => { return Object.assign({}, state, { loaded: false }); - case types.CHANGE_EXPLODE_ATTR: /* fall-through */ - case types.CHANGE_DATES_VISIBILITY_THICKNESS: /* fall-through */ + case types.CHANGE_EXPLODE_ATTR: /* fallthrough */ + case types.CHANGE_DATES_VISIBILITY_THICKNESS: /* fallthrough */ case types.UPDATE_VISIBILITY_AND_BRANCH_THICKNESS: const newStates = { visibility: action.visibility, diff --git a/src/reducers/treeToo.js b/src/reducers/treeToo.js index 5c686950b..cf6a8a207 100644 --- a/src/reducers/treeToo.js +++ b/src/reducers/treeToo.js @@ -34,7 +34,7 @@ const treeToo = (state = getDefaultTreeState(), action) => { switch (action.type) { case types.REMOVE_TREE_TOO: return getDefaultTreeState(); - case types.CHANGE_DATES_VISIBILITY_THICKNESS: /* fall-through */ + case types.CHANGE_DATES_VISIBILITY_THICKNESS: /* fallthrough */ case types.UPDATE_VISIBILITY_AND_BRANCH_THICKNESS: if (action.tangleTipLookup) { // console.warn("NB missing visibleStateCounts from treeToo here"); diff --git a/src/util/colorScale.js b/src/util/colorScale.js index 2a59a375d..b1f2d309a 100644 --- a/src/util/colorScale.js +++ b/src/util/colorScale.js @@ -303,7 +303,7 @@ function getMinMaxFromTree(nodes, nodesToo, attr) { } /* this creates a (ramped) list of colours - this is necessary as ordinal scales can't interpololate colours. + this is necessary as ordinal scales can't interpolate colours. range: [a,b], the colours to go between */ function createListOfColors(n, range) { const scale = scaleLinear().domain([0, n]) diff --git a/src/util/entropy.js b/src/util/entropy.js index 9a627477a..0b0861945 100644 --- a/src/util/entropy.js +++ b/src/util/entropy.js @@ -209,11 +209,11 @@ const calcEntropy = (nodes, visibility, geneMap, isAA) => { }; /** -* traverse the tree and compile the entropy data for the visibile branches +* traverse the tree and compile the entropy data for the visible branches * @param {Array} nodes - list of nodes * @param {Array} visibility - 1-1 correspondence with nodes. * @param {String} mutType - amino acid | nucleotide mutations - "aa" | "nuc" -* @param {obj} geneMap used to NT fill colours. This should be imroved. +* @param {obj} geneMap used to NT fill colours. This should be improved. * @param {bool} showCounts show counts or entropy values? * @return {obj} keys: the entries in attrs. Values: an object mapping values -> counts * TODO: this algorithm can be much improved, and the data structures returned improved also diff --git a/src/util/treeJsonProcessing.js b/src/util/treeJsonProcessing.js index fd0bce154..42e1f9fd7 100644 --- a/src/util/treeJsonProcessing.js +++ b/src/util/treeJsonProcessing.js @@ -10,7 +10,7 @@ const pseudoRandomName = () => (Math.random()*1e32).toString(36).slice(0, 6); * node.hasChildren {bool} * node.arrayIdx {integer} - the index of the node in the nodes array * @param {array} nodes redux tree nodes - * @return {array} input array (kinda unneccessary) + * @return {array} input array (kinda unnecessary) * side-effects: node.hasChildren (bool) and node.arrayIdx (INT) for each node in nodes */ const processNodes = (nodes) => { @@ -21,7 +21,7 @@ const processNodes = (nodes) => { d.hasChildren = typeof d.children !== "undefined"; /* duplicate or missing names are an error with the dataset, but typically result in - very hard-to-interpret Auspice errors which we can improve by dectecting problems early */ + very hard-to-interpret Auspice errors which we can improve by detecting problems early */ if (!d.name) { d.name = pseudoRandomName(); console.warn(`Tree node without a name detected. Using the name '${d.name}' and continuing...`); diff --git a/src/util/treeVisibilityHelpers.js b/src/util/treeVisibilityHelpers.js index ea6cb326d..a16552b34 100644 --- a/src/util/treeVisibilityHelpers.js +++ b/src/util/treeVisibilityHelpers.js @@ -96,7 +96,7 @@ const makeParentVisible = (visArray, node) => { /* Recursively hide nodes that do not have more than one child node by updating * the boolean values in the param visArray. * Relies on visArray having been updated by `makeParentVisible` - * Returns the index of the visible commonn ancestor. */ + * Returns the index of the visible common ancestor. */ const hideNodesAboveVisibleCommonAncestor = (visArray, node) => { if (!node.hasChildren) { return node.arrayIdx; // Terminal node without children @@ -161,7 +161,7 @@ const getFilteredAndIdxOfFilteredRoot = (tree, controls, inView) => { }); if (filters.length) { - /* find the terminal nodes that were (a) already visibile and (b) match the filters */ + /* find the terminal nodes that were (a) already visible and (b) match the filters */ filtered = tree.nodes.map((d, idx) => ( !d.hasChildren && inView[idx] && filters.every((f) => f.values.includes(getTraitFromNode(d, f.trait))) )); @@ -169,11 +169,11 @@ const getFilteredAndIdxOfFilteredRoot = (tree, controls, inView) => { if (e) {a.push(i);} return a; }, []); - /* for each visibile tip, make the parent nodes visible (recursively) */ + /* for each visible tip, make the parent nodes visible (recursively) */ for (let i = 0; i < idxsOfFilteredTips.length; i++) { makeParentVisible(filtered, tree.nodes[idxsOfFilteredTips[i]]); } - /* Recursivley hide ancestor nodes that are not the last common + /* Recursively hide ancestor nodes that are not the last common * ancestor of selected nodes, starting from the root of the tree */ idxOfFilteredRoot = hideNodesAboveVisibleCommonAncestor(filtered, tree.nodes[0]); } @@ -198,9 +198,9 @@ visibility: array of integers in {0, 1, 2} ROUGH DESCRIPTION OF HOW FILTERING IS APPLIED: - inView filtering (reflects tree zooming): Nodes which are not inView always have visibility=0 - time filtering is simple - all nodes (internal + terminal) not within (tmin, tmax) are excluded. - - filters are a bit more tricky - the visibile tips are calculated, and the parent - branches back to the MRCA are considered visibile. This is then intersected with - the time & inView visibile stuff + - filters are a bit more tricky - the visible tips are calculated, and the parent + branches back to the MRCA are considered visible. This is then intersected with + the time & inView visible stuff */ export const calcVisibility = (tree, controls, dates, inView, filtered) => { if (tree.nodes) { @@ -250,7 +250,7 @@ export const calculateVisiblityAndBranchThickness = (tree, controls, dates) => { }; /** - * Compute whether each node is filtered (visibile) by any defined genotype filters. + * Compute whether each node is filtered (visible) by any defined genotype filters. * * Idea behind how we check genotype filter matches: * A "constellation" is a set of mutations -- for instance, the filters define such a set (see `filterConstellationLong`) diff --git a/webpack.config.js b/webpack.config.js index 6ca430868..8da5d32c8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -119,7 +119,7 @@ const generateConfig = ({extensionPath, devMode=false, customOutputPath, analyze * of the big vendor bundle, so we must be sure they're stable both internally * and with respect to the implementation. * The hashes of the bundles are hardcoded in bundlesize so it will trigger - * a check error if it is unadvertently changed. + * a check error if it is inadvertently changed. */ const coreVendors = [ "@babel/runtime", @@ -143,7 +143,7 @@ const generateConfig = ({extensionPath, devMode=false, customOutputPath, analyze * For example d3-.* is here even if it's a core library, because if we * include some new d3 feature, the whole bundle will change. * The hashes of the bundles are hardcoded in bundlesize so it will trigger - * a check error if it is unadvertently changed. + * a check error if it is inadvertently changed. */ const bigVendors = [ "d3-.*", // d3 is imported selectively, new usages may change the bundle