Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 11, 2023
1 parent 63b8311 commit f1cefa3
Show file tree
Hide file tree
Showing 51 changed files with 199 additions and 199 deletions.
2 changes: 1 addition & 1 deletion docs/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ D,John,Fish`;
<script>
ReactDOM.render(
React.createElement(Taxonium, { sourceData: sourceData }),
document.getElementById("root")
document.getElementById("root"),
);
</script>
</body>
Expand Down
26 changes: 13 additions & 13 deletions taxonium_backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ program
.option("--data_url <data url>", "data url")
.option(
"--data_file <data file>",
"local data file, as alternative to data url"
"local data file, as alternative to data url",
);

program.parse();
Expand Down Expand Up @@ -154,7 +154,7 @@ app.get("/search", function (req, res) {
result.data.length +
" results in " +
(Date.now() - start_time) +
"ms"
"ms",
);
console.log("Result type was " + result.type);
});
Expand Down Expand Up @@ -256,7 +256,7 @@ app.get("/nodes/", function (req, res) {
max_y,
min_x,
max_x,
req.query.xType
req.query.xType,
);
}
console.log("Ready to send after " + (Date.now() - start_time) + "ms.");
Expand All @@ -268,19 +268,19 @@ app.get("/nodes/", function (req, res) {
(Date.now() - start_time) +
"ms, and output " +
result.length +
" nodes."
" nodes.",
);
});

function startListening() {
if (command_options.ssl) {
options = {
key: fs.readFileSync(
"/etc/letsencrypt/live/api.taxonium.org/privkey.pem"
"/etc/letsencrypt/live/api.taxonium.org/privkey.pem",
),
ca: fs.readFileSync("/etc/letsencrypt/live/api.taxonium.org/chain.pem"),
cert: fs.readFileSync(
"/etc/letsencrypt/live/api.taxonium.org/fullchain.pem"
"/etc/letsencrypt/live/api.taxonium.org/fullchain.pem",
),
};
https.createServer(options, app).listen(command_options.port, "0.0.0.0");
Expand Down Expand Up @@ -452,7 +452,7 @@ app.get("/node_details/", async (req, res) => {
}
validateSIDandSend(detailed_node, req.query.sid, res);
console.log(
"Request took " + (Date.now() - start_time) + "ms, and output " + node
"Request took " + (Date.now() - start_time) + "ms, and output " + node,
);
});

Expand All @@ -463,7 +463,7 @@ app.get("/tip_atts", async (req, res) => {
const atts = filtering.getTipAtts(processedData.nodes, node_id, att);
validateSIDandSend(atts, req.query.sid, res);
console.log(
"Request took " + (Date.now() - start_time) + "ms, and output " + atts
"Request took " + (Date.now() - start_time) + "ms, and output " + atts,
);
});

Expand All @@ -474,11 +474,11 @@ app.get("/nextstrain_json/:root_id", async (req, res) => {
root_id,
processedData.nodes,
config,
processedData.mutations
processedData.mutations,
);
res.setHeader(
"Content-Disposition",
"attachment; " + "filename=" + root_id + ".nextstrain.json"
"attachment; " + "filename=" + root_id + ".nextstrain.json",
);
res.send(json);
});
Expand All @@ -505,7 +505,7 @@ const loadData = async () => {
processedData = await importing.processJsonl(
supplied_object,
logStatusMessage,
ReadableWebToNodeStream.ReadableWebToNodeStream
ReadableWebToNodeStream.ReadableWebToNodeStream,
);

logStatusMessage({
Expand All @@ -517,7 +517,7 @@ const loadData = async () => {
}

processedData.genes = new Set(
processedData.mutations.map((mutation) => mutation.gene)
processedData.mutations.map((mutation) => mutation.gene),
);
// as array
processedData.genes = Array.from(processedData.genes);
Expand All @@ -530,7 +530,7 @@ const loadData = async () => {
processedData.overallMaxY,
processedData.overallMinX,
processedData.overallMaxX,
"x_dist"
"x_dist",
);

cached_starting_values = result;
Expand Down
2 changes: 1 addition & 1 deletion taxonium_component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If you're working with basic HTML, you can include the Taxonium component using
<script>
ReactDOM.render(
React.createElement(Taxonium, { sourceData: sourceData }),
document.getElementById("root")
document.getElementById("root"),
);
</script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions taxonium_component/src/Deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function Deck({
// Treenome state
const setMouseXY = useCallback(
(info) => view.setMouseXY([info.x, info.y]),
[view]
[view],
);
const [treenomeReferenceInfo, setTreenomeReferenceInfo] = useState(null);

Expand All @@ -91,7 +91,7 @@ function Deck({
mouseDownPos.current &&
Math.sqrt(
Math.pow(mouseDownPos.current[0] - event.clientX, 2) +
Math.pow(mouseDownPos.current[1] - event.clientY, 2)
Math.pow(mouseDownPos.current[1] - event.clientY, 2),
) > pan_threshold
) {
return false;
Expand Down Expand Up @@ -148,7 +148,7 @@ function Deck({
onViewStateChange,
xzoom,
deckRef,
]
],
);

const [hoverInfo, setHoverInfoRaw] = useState(null);
Expand All @@ -166,7 +166,7 @@ function Deck({
hoverDetails.clearNodeDetails();
}
},
[hoverDetails]
[hoverDetails],
);

const { layers, layerFilter, keyStuff } = useLayers({
Expand Down
6 changes: 3 additions & 3 deletions taxonium_component/src/Taxonium.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Taxonium({
backendUrl ? backendUrl : query.backend,
query.sid,
url_on_fail,
sourceData
sourceData,
);
let hoverDetails = useHoverDetails();
const gisaidHoverDetails = useNodeDetails("gisaid-hovered", backend);
Expand All @@ -93,7 +93,7 @@ function Taxonium({
setTitle,
query,
configDict,
configUrl
configUrl,
);
const colorBy = useColorBy(config, query, updateQuery);
const colorMapping = useMemo(() => {
Expand All @@ -110,7 +110,7 @@ function Taxonium({
(xType) => {
updateQuery({ xType });
},
[updateQuery]
[updateQuery],
);

const { data, boundsForQueries, isCurrentlyOutsideBounds } =
Expand Down
6 changes: 3 additions & 3 deletions taxonium_component/src/components/Basic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Button = ({
className={classNames(
"tx-button no-underline",
"border border-gray-400 shadow-sm rounded py-1 px-2 bg-gray-100 hover:bg-gray-200 text-sm text-gray-700",
className
className,
)}
href={href}
title={title}
Expand All @@ -32,7 +32,7 @@ export const Button = ({
className={classNames(
"tx-button",
"border border-gray-400 shadow-sm rounded py-1 px-2 bg-gray-100 hover:bg-gray-200 text-sm text-gray-700",
className
className,
)}
onClick={onClick}
title={title}
Expand All @@ -49,7 +49,7 @@ export const Select = ({ onChange, className, children, value, title }) => {
className={classNames(
"border bg-white text-gray-900 text-sm hover:text-gray-700 py-1 pl-2 pr-6",
"focus:ring-gray-800 focus:border-gray-800",
className
className,
)}
onChange={onChange}
value={value}
Expand Down
8 changes: 4 additions & 4 deletions taxonium_component/src/components/DeckSettingsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const DeckSettingsModal = ({
checked={settings.displayTextForInternalNodes}
onChange={() =>
settings.setDisplayTextForInternalNodes(
!settings.displayTextForInternalNodes
!settings.displayTextForInternalNodes,
)
}
/>{" "}
Expand All @@ -65,7 +65,7 @@ const DeckSettingsModal = ({
checked={settings.displayPointsForInternalNodes}
onChange={() =>
settings.setDisplayPointsForInternalNodes(
!settings.displayPointsForInternalNodes
!settings.displayPointsForInternalNodes,
)
}
/>{" "}
Expand All @@ -81,7 +81,7 @@ const DeckSettingsModal = ({
value={settings.thresholdForDisplayingText}
onChange={(e) =>
settings.setThresholdForDisplayingText(
parseFloat(e.target.value)
parseFloat(e.target.value),
)
}
step="0.1"
Expand Down Expand Up @@ -120,7 +120,7 @@ const DeckSettingsModal = ({
onChange={() =>
settings.setMutationTypeEnabled(
key,
!settings.mutationTypesEnabled[key]
!settings.mutationTypesEnabled[key],
)
}
/>{" "}
Expand Down
2 changes: 1 addition & 1 deletion taxonium_component/src/components/JBrowseErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class JBrowseErrorBoundary extends React.Component {
error.message === "Invalid array length"
) {
toast.error(
"Error displaying track. Please make sure your file is well-formatted (e.g., validated with https://github.com/EBIvariation/vcf-validator)."
"Error displaying track. Please make sure your file is well-formatted (e.g., validated with https://github.com/EBIvariation/vcf-validator).",
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions taxonium_component/src/components/JBrowsePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function JBrowsePanel(props) {
state.session.view
) {
freezeTracks.forEach((t) =>
state.session.view.showTrack(t.configuration.trackId)
state.session.view.showTrack(t.configuration.trackId),
);
}
}, [freezeTracks, state]);
Expand All @@ -308,7 +308,7 @@ function JBrowsePanel(props) {
const widget = state.session.addWidget(
"AddTrackWidget",
"addTrackWidget",
{ view: state.session.view.id }
{ view: state.session.view.id },
);
// AddTrackWidget calls session.addTrackConf, which
// doesn't appear to be defined in the session object
Expand All @@ -332,7 +332,7 @@ function JBrowsePanel(props) {
":" +
props.treenomeState.ntBoundsExt[0] +
".." +
props.treenomeState.ntBoundsExt[1]
props.treenomeState.ntBoundsExt[1],
);
props.treenomeState.setNtBoundsExt(null);
}, [props.settings.chromosomeName, props.treenomeState, state.session.view]);
Expand Down
2 changes: 1 addition & 1 deletion taxonium_component/src/components/Key.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Key = ({
<div
className={classNames(
"px-2 border-right border bg-white opacity-90 absolute bottom-2 left-2 pt-1 pb-2",
collapsed ? "w-20" : "w-32"
collapsed ? "w-20" : "w-32",
)}
>
<h3
Expand Down
4 changes: 2 additions & 2 deletions taxonium_component/src/components/NodeHoverTip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const NodeHoverTip = ({
hoveredNode[key]
)}
</div>
)
),
)}

{config.mutations.length > 0 && (
Expand Down Expand Up @@ -164,7 +164,7 @@ const NodeHoverTip = ({
<div className="mt-1 justify">
<b className="font-semibold">Authors:</b>{" "}
{fixAuthors(
hoverDetails.nodeDetails.acknowledgements.covv_authors
hoverDetails.nodeDetails.acknowledgements.covv_authors,
)}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions taxonium_component/src/components/SearchItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const SearchItem = ({ singleSearchSpec, setThisSearchSpec, config }) => {
}

return [type.name, obj];
})
}),
);

const setTypeTo = (type) => {
Expand Down Expand Up @@ -326,7 +326,7 @@ const SearchItem = ({ singleSearchSpec, setThisSearchSpec, config }) => {
(foundsubspec, i) =>
i === singleSearchSpec.subspecs.indexOf(subspec)
? new_subspec
: foundsubspec
: foundsubspec,
),
});
}}
Expand All @@ -340,7 +340,7 @@ const SearchItem = ({ singleSearchSpec, setThisSearchSpec, config }) => {
...singleSearchSpec,
subspecs: singleSearchSpec.subspecs.filter(
(compsubspec, i) =>
i !== singleSearchSpec.subspecs.indexOf(subspec)
i !== singleSearchSpec.subspecs.indexOf(subspec),
),
});
}}
Expand Down
Loading

0 comments on commit f1cefa3

Please sign in to comment.