Skip to content

Commit

Permalink
fix img path, run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Oct 9, 2023
1 parent b934e31 commit b2c6e30
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ repos:
hooks:
- id: prettier
additional_dependencies:
- prettier@2.3.2
- "@prettier/plugin-pug@1.16.5"
- prettier
- "@prettier/plugin-pug"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending

- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v8.50.0"
rev: "v8.51.0"
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
Expand Down
2 changes: 1 addition & 1 deletion docs/svg.filter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
"method_weights": [0, 1, 0, 0, 0],
"application_weights": [1, 0, 0, 0, 0, 0]
},
{
{
"name": "Prof. Dr. Martin Dugas",
"group": "Medical Informatics",
"website": "https://www.klinikum.uni-heidelberg.de/mi/",
"description": "Since 2021 Martin Dugas is Director of the Institute for Medical Informatics [ukhd.de/imi] at Heidelberg University Hospital. He holds a doctoral degree in human medicine as well as a diploma in computer science. His research is focused on medical informations systems and data integration, specifically structured patient data. He received the venia legendi for Medical Informatics in 2002 at the University of Munich, Germany. From 2004 to 2005 he was a research fellow at Siemens Medical Health Services, USA. 2005-2021 he was professor of Medical Informatics at the University of Münster. In 2011 he and his team established the Portal of Medical Data Models, a research information infrastructure funded by the German Research Foundation.",
"image": "Dugas_sw/0.png",
"image": "Dugas_sw.png",
"method_weights": [0, 0, 1, 0, 0],
"application_weights": [0, 1, 0, 0, 0, 0]
},
Expand Down
46 changes: 23 additions & 23 deletions src/js/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ let sort_by_group = false;

const updateSegments = function () {
for (const group_card of SVG("#iwr-vis-menu-svg").find(
".iwr-vis-group-card"
".iwr-vis-group-card",
)) {
group_card.css({ opacity: "0", visibility: "hidden" });
}
for (const group_item of SVG("#iwr-vis-menu-svg").find(
".iwr-vis-group-item"
".iwr-vis-group-item",
)) {
group_item.show();
}
Expand Down Expand Up @@ -50,7 +50,7 @@ function updateGroups(
show_all = false,
zoom = 1,
cx = 200,
cy = 200
cy = 200,
) {
updateSegments();
const items = SVG("#iwr-vis-menu-svg").find(".iwr-vis-group-item");
Expand Down Expand Up @@ -182,11 +182,11 @@ function applyWeightedHighlights(items, weights) {
const highlightSegments = function () {
applyWeightedHighlights(
SVG("#iwr-vis-menu-svg").find(".iwr-vis-method-item"),
this.data("method_weights")
this.data("method_weights"),
);
applyWeightedHighlights(
SVG("#iwr-vis-menu-svg").find(".iwr-vis-application-item"),
this.data("application_weights")
this.data("application_weights"),
);
};

Expand All @@ -202,7 +202,7 @@ function addSegments(
color,
radius,
width,
segmentClass
segmentClass,
) {
const delta = 360 / (names.length + 1);
for (let i = 0; i < names.length; i++) {
Expand All @@ -222,7 +222,7 @@ function addSegments(
});
group
.path(
Utils.makeSegment(radius, (i + 0.5) * delta, (i + 1.5) * delta, width)
Utils.makeSegment(radius, (i + 0.5) * delta, (i + 1.5) * delta, width),
)
.addClass("iwr-vis-segment-item-arc")
.fill(color)
Expand Down Expand Up @@ -266,8 +266,8 @@ function addSegments(
Utils.makeArrowArc(
radius,
arrowPadding + txtAngle,
delta / 2 - arrowPadding
)
delta / 2 - arrowPadding,
),
)
.fill("none")
.stroke(color)
Expand All @@ -278,8 +278,8 @@ function addSegments(
Utils.makeArrowArc(
radius,
-arrowPadding - txtAngle,
-delta / 2 + arrowPadding
)
-delta / 2 + arrowPadding,
),
)
.fill("none")
.stroke(color)
Expand All @@ -293,7 +293,7 @@ function addGroups(
method_weights,
application_weights,
color,
image_base_url
image_base_url,
) {
const boxHeight = 60;
const boxWidth = 200;
Expand Down Expand Up @@ -368,7 +368,7 @@ function addGroups(
// large professor name
let dy = 0;
for (const textLine of Utils.shortenName(members[i].name, true).split(
"\n"
"\n",
)) {
group
.text(textLine)
Expand Down Expand Up @@ -425,7 +425,7 @@ function addGroupCard(svg, member, color, image_base_url) {
close_button_x,
close_button_y,
close_button_x + close_button_size,
close_button_y + close_button_size
close_button_y + close_button_size,
)
.stroke("#777777")
.attr({ "stroke-width": 0.5 });
Expand All @@ -434,7 +434,7 @@ function addGroupCard(svg, member, color, image_base_url) {
close_button_x + close_button_size,
close_button_y,
close_button_x,
close_button_y + close_button_size
close_button_y + close_button_size,
)
.stroke("#777777")
.attr({ "stroke-width": 0.5 });
Expand Down Expand Up @@ -477,8 +477,8 @@ function addGroupCard(svg, member, color, image_base_url) {
'<div xmlns="http://www.w3.org/1999/xhtml" class="iwr-vis-group-card-html">' +
member.description +
"</div>",
true
)
true,
),
);
}

Expand All @@ -497,7 +497,7 @@ const zoomGroups = function (e) {
true,
z,
200 + (1 - z) * (p.x - 200),
200 + (1 - z) * (p.y - 200)
200 + (1 - z) * (p.y - 200),
);
} else {
updateGroups(null, true, 1, 200, 200);
Expand All @@ -506,10 +506,10 @@ const zoomGroups = function (e) {

const sortGroupsByProf = function () {
const group = SVG("#iwr-vis-menu-svg").find(
".iwr-vis-settings-menu-sort-by-group"
".iwr-vis-settings-menu-sort-by-group",
);
const prof = SVG("#iwr-vis-menu-svg").find(
".iwr-vis-settings-menu-sort-by-prof"
".iwr-vis-settings-menu-sort-by-prof",
);
if (this.findOne(".iwr-vis-settings-menu-sort-by-prof") != null) {
prof.fill("#777777");
Expand Down Expand Up @@ -642,7 +642,7 @@ function create_iwr_vis(data) {
method_weights,
application_weights,
data.group_color,
data.image_base_url
data.image_base_url,
);
// methods
addSegments(
Expand All @@ -653,7 +653,7 @@ function create_iwr_vis(data) {
data.method_color,
168,
10,
"iwr-vis-method-item"
"iwr-vis-method-item",
);
// applications
addSegments(
Expand All @@ -664,7 +664,7 @@ function create_iwr_vis(data) {
data.application_color,
188,
10,
"iwr-vis-application-item"
"iwr-vis-application-item",
);
resetAll();
// settings menu
Expand Down
12 changes: 6 additions & 6 deletions src/js/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function transpose<T>(m: T[][]) {
// get indices of sorted array of objects, sorted by given member of object
export function sorted_indices(
array: Array<Record<string, object>>,
member: string
member: string,
) {
const len = array.length;
const indices = new Array(len);
Expand Down Expand Up @@ -70,7 +70,7 @@ function xy(radius: number, deg: number) {
export function makeTextArc(
radius: number,
startAngle: number,
endAngle: number
endAngle: number,
) {
const anticlockwise = startAngle > 70 && endAngle < 290;
if (anticlockwise) {
Expand All @@ -82,7 +82,7 @@ export function makeTextArc(
const p1 = xy(radius, endAngle);
if (anticlockwise) {
return ["M", p1.x, p1.y, "A", radius, radius, 0, 0, 0, p0.x, p0.y].join(
" "
" ",
);
}
return ["M", p0.x, p0.y, "A", radius, radius, 0, 0, 1, p1.x, p1.y].join(" ");
Expand All @@ -91,7 +91,7 @@ export function makeTextArc(
export function makeArrowArc(
radius: number,
startAngle: number,
endAngle: number
endAngle: number,
) {
const p0 = xy(radius, startAngle);
const p1 = xy(radius, endAngle);
Expand All @@ -116,7 +116,7 @@ export function makeSegment(
radius: number,
startAngle: number,
endAngle: number,
width: number
width: number,
) {
const rm = radius - width;
const rp = radius + width;
Expand Down Expand Up @@ -154,7 +154,7 @@ export function makeSegment(
export function nextGroupBoxIndex(
p: { x: number; y: number },
ncols: number,
nrows = 0
nrows = 0,
) {
let x_max = ncols - 1;
let x_min = 0;
Expand Down

0 comments on commit b2c6e30

Please sign in to comment.