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 Dec 18, 2023
1 parent 6d28878 commit f7cbfbf
Show file tree
Hide file tree
Showing 53 changed files with 230 additions and 250 deletions.
36 changes: 8 additions & 28 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": false,
"contributors": [
Expand All @@ -10,67 +8,49 @@
"name": "Alex Kramer",
"avatar_url": "https://avatars.githubusercontent.com/u/6502785?v=4",
"profile": "https://github.com/amkram",
"contributions": [
"code",
"design",
"ideas"
]
"contributions": ["code", "design", "ideas"]
},
{
"login": "AngieHinrichs",
"name": "Angie Hinrichs",
"avatar_url": "https://avatars.githubusercontent.com/u/186983?v=4",
"profile": "http://genome.ucsc.edu/",
"contributions": [
"ideas",
"data"
]
"contributions": ["ideas", "data"]
},
{
"login": "richardgoater",
"name": "Richard Goater",
"avatar_url": "https://avatars.githubusercontent.com/u/1429721?v=4",
"profile": "https://github.com/richardgoater",
"contributions": [
"design",
"code"
]
"contributions": ["design", "code"]
},
{
"login": "chaoran-chen",
"name": "Chaoran Chen",
"avatar_url": "https://avatars.githubusercontent.com/u/18666552?v=4",
"profile": "https://github.com/chaoran-chen",
"contributions": [
"ideas"
]
"contributions": ["ideas"]
},
{
"login": "corneliusroemer",
"name": "Cornelius Roemer",
"avatar_url": "https://avatars.githubusercontent.com/u/25161793?v=4",
"profile": "https://github.com/corneliusroemer",
"contributions": [
"ideas"
]
"contributions": ["ideas"]
},
{
"login": "sungyeonkwon",
"name": "Sung Kwon",
"avatar_url": "https://avatars.githubusercontent.com/u/25865179?v=4",
"profile": "https://github.com/sungyeonkwon",
"contributions": [
"infra"
]
"contributions": ["infra"]
},
{
"login": "kvargha",
"name": "Koorous Vargha",
"avatar_url": "https://avatars.githubusercontent.com/u/35252220?v=4",
"profile": "https://kvargha.com/",
"contributions": [
"code"
]
"contributions": ["code"]
}
],
"contributorsPerLine": 7,
Expand Down
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 @@ -73,7 +73,7 @@ function Deck({
// Treenome state
const setMouseXY = useCallback(
(info) => view.setMouseXY([info.x, info.y]),
[view]
[view],
);
const [treenomeReferenceInfo, setTreenomeReferenceInfo] = useState(null);

Expand All @@ -99,7 +99,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 @@ -157,7 +157,7 @@ function Deck({
onViewStateChange,
xzoom,
deckRef,
]
],
);

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

const { layers, layerFilter, keyStuff, triggerSVGdownload } = 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 @@ -84,7 +84,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 @@ -100,7 +100,7 @@ function Taxonium({
setTitle,
query,
configDict,
configUrl
configUrl,
);
const colorBy = useColorBy(config, query, updateQuery);
const [additionalColorMapping, setAdditionalColorMapping] = useState({});
Expand All @@ -119,7 +119,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
10 changes: 5 additions & 5 deletions taxonium_component/src/components/DeckSettingsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const DeckSettingsModal = ({
checked={settings.displayTextForInternalNodes}
onChange={() =>
settings.setDisplayTextForInternalNodes(
!settings.displayTextForInternalNodes
!settings.displayTextForInternalNodes,
)
}
/>{" "}
Expand All @@ -90,7 +90,7 @@ const DeckSettingsModal = ({
checked={settings.displayPointsForInternalNodes}
onChange={() =>
settings.setDisplayPointsForInternalNodes(
!settings.displayPointsForInternalNodes
!settings.displayPointsForInternalNodes,
)
}
/>{" "}
Expand All @@ -110,7 +110,7 @@ const DeckSettingsModal = ({
onChange={() =>
settings.setMutationTypeEnabled(
key,
!settings.mutationTypesEnabled[key]
!settings.mutationTypesEnabled[key],
)
}
/>{" "}
Expand All @@ -133,7 +133,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 @@ -263,7 +263,7 @@ const DeckSettingsModal = ({
checked={settings.displaySearchesAsPoints}
onChange={() =>
settings.setDisplaySearchesAsPoints(
!settings.displaySearchesAsPoints
!settings.displaySearchesAsPoints,
)
}
/>{" "}
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
Loading

0 comments on commit f7cbfbf

Please sign in to comment.