Skip to content

Commit

Permalink
Removed unneeded diagram height extractor cod from a previous itterat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
qtzar committed Oct 20, 2023
1 parent 4de7676 commit fe4478d
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ fun copySiteWideAssets(exportDir: File) {
copySiteWideAsset(exportDir, "/css/admonition.css")
copySiteWideAsset(exportDir, "/js/admonition.js")
copySiteWideAsset(exportDir, "/js/reformat-mermaid.js")
copySiteWideAsset(exportDir, "/js/svg-pan-zoom.js")
copySiteWideAsset(exportDir, "/js/svg-pan-zoom-modal.js")
copySiteWideAsset(exportDir, "/css/treeview.css")
copySiteWideAsset(exportDir, "/js/treeview.js")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ data class DiagramViewModel(
val name: String,
val svg: String?,
val diagramWidthInPixels: Int?,
val diagramHeightInPixels: Int?,
val svgLocation: ImageViewModel,
val pngLocation: ImageViewModel,
val pumlLocation: ImageViewModel
Expand All @@ -27,7 +26,6 @@ data class DiagramViewModel(
name,
svg,
extractDiagramWidthInPixels(svg),
extractDiagramHeightInPixels(svg),
ImageViewModel(pageViewModel, "/svg/${key}.svg"),
ImageViewModel(pageViewModel, "/png/${key}.png"),
ImageViewModel(pageViewModel, "/puml/${key}.puml")
Expand All @@ -41,13 +39,5 @@ data class DiagramViewModel(
?.let { it.groupValues[1].toInt() }
?: throw IllegalStateException("No viewBox attribute found in SVG!")
else null

private fun extractDiagramHeightInPixels(svg: String?) =
if (svg != null)
"viewBox=\"\\d+ \\d+ \\d+ (\\d+)\"".toRegex()
.find(svg)
?.let { it.groupValues[1].toInt() }
?: throw IllegalStateException("No viewBox attribute found in SVG!")
else null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class SoftwareSystemComponentPageViewModelTest : ViewModelTest() {
"Software system - Backend - Components",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/component-1.svg"),
ImageViewModel(viewModel, "/png/component-1.png"),
ImageViewModel(viewModel, "/puml/component-1.puml")
Expand All @@ -44,7 +43,6 @@ class SoftwareSystemComponentPageViewModelTest : ViewModelTest() {
"Software system - Backend - Components",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/component-2.svg"),
ImageViewModel(viewModel, "/png/component-2.png"),
ImageViewModel(viewModel, "/puml/component-2.puml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class SoftwareSystemContainerPageViewModelTest : ViewModelTest() {
"Software system - Containers",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/container-1.svg"),
ImageViewModel(viewModel, "/png/container-1.png"),
ImageViewModel(viewModel, "/puml/container-1.puml")
Expand All @@ -43,7 +42,6 @@ class SoftwareSystemContainerPageViewModelTest : ViewModelTest() {
"Software system - Containers",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/container-2.svg"),
ImageViewModel(viewModel, "/png/container-2.png"),
ImageViewModel(viewModel, "/puml/container-2.puml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class SoftwareSystemContextPageViewModelTest : ViewModelTest() {
"Software system - System Context",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/context-1.svg"),
ImageViewModel(viewModel, "/png/context-1.png"),
ImageViewModel(viewModel, "/puml/context-1.puml")
Expand All @@ -34,7 +33,6 @@ class SoftwareSystemContextPageViewModelTest : ViewModelTest() {
"Software system - System Context",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/context-2.svg"),
ImageViewModel(viewModel, "/png/context-2.png"),
ImageViewModel(viewModel, "/puml/context-2.puml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class SoftwareSystemDeploymentPageViewModelTest : ViewModelTest() {
"Software system - Deployment - Default",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/deployment-1.svg"),
ImageViewModel(viewModel, "/png/deployment-1.png"),
ImageViewModel(viewModel, "/puml/deployment-1.puml")
Expand All @@ -43,7 +42,6 @@ class SoftwareSystemDeploymentPageViewModelTest : ViewModelTest() {
"Software system - Deployment - Default",
"""<svg viewBox="0 0 800 900"></svg>""",
800,
900,
ImageViewModel(viewModel, "/svg/deployment-2.svg"),
ImageViewModel(viewModel, "/png/deployment-2.png"),
ImageViewModel(viewModel, "/puml/deployment-2.puml")
Expand Down

0 comments on commit fe4478d

Please sign in to comment.