Skip to content

Commit

Permalink
Update API and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken McGrady committed Dec 6, 2021
1 parent 950cf98 commit 6e16181
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
8 changes: 4 additions & 4 deletions streamlit_org_chart/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/d3": "^7.0.0",
"@types/d3": "^7.1.0",
"@types/d3-org-chart": "^2.3.0",
"@types/jest": "^24.0.0",
"@types/node": "^12.0.0",
"d3": "^7.0.1",
"d3-flextree": "^2.1.1",
"d3-org-chart": "^2.3.3",
"d3": "^7.2.0",
"d3-flextree": "^2.1.2",
"d3-org-chart": "^2.5.4",
"react-scripts": "3.4.1",
"streamlit-component-lib": "^1.1.3",
"typescript": "~3.7.2"
Expand Down
15 changes: 4 additions & 11 deletions streamlit_org_chart/frontend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function onRender(event: Event): void {
.svgHeight(window.innerHeight)
.nodeWidth((d) => 384)
.initialZoom(1)
.nodeHeight((d) => 240)
.nodeHeight((d) => 260)
.childrenMargin((d) => 40)
.compactMarginBetween((d) => 15)
.compactMarginPair((d) => 80)
Expand Down Expand Up @@ -84,15 +84,15 @@ function onRender(event: Event): void {
name.style.fontWeight = "bold"
name.style.textAlign = "center"
name.style.marginTop = "14px"
name.textContent = d.data.name || ""
name.textContent = d.data.primary || ""

card.appendChild(name)

const role = document.createElement("div")
role.style.fontSize = "16px"
role.style.textAlign = "center"
role.style.marginTop = "2px"
role.textContent = d.data.positionName || ""
role.textContent = d.data.secondary || ""

card.appendChild(role)

Expand All @@ -106,15 +106,8 @@ function onRender(event: Event): void {
optionsText.style.alignSelf = "flex-end"
optionsText.style.textAlign = "center"
optionsText.style.fontSize = "14px"
const optionsContent = []
if (d.data.department) {
optionsContent.push(d.data.department)
}
if (d.data.location) {
optionsContent.push(d.data.location)
}

optionsText.textContent = optionsContent.join(" • ")
optionsText.textContent = d.data.tertiary || ""

options.appendChild(optionsText)
card.appendChild(options)
Expand Down

0 comments on commit 6e16181

Please sign in to comment.