Relationship labels are lost during SVG layout
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- haskell
- Domain
- computer-graphics
Research direction
Start with src/Modelling/Auxiliary/Diagrams.hs around line 546, where the issue points to tangent vector calculation and normalization. Inspect how the SVG layout computes the label position for a nearly straight relationship segment and check the generated SVG for NaN values. Done when the “supports” label is rendered correctly and the SVG contains no NaN values for this task.
Written by the indexing model from the issue text.
Description
and its task instance:
NameCdErrorInstance
{ byName = True
, classDiagram = AnnotatedClassDiagram
{ annotatedClasses =
[ "ComputerSystem"
, "Processor"
, "QuadCoreProcessor"
, "MultiCoreProcessor"
, "InstructionSet"
]
, annotatedRelationships =
[ Annotation
{ annotated = Right (Association
{ associationName = "supports"
, associationFrom = (LimitedLinking
{ linking = "ComputerSystem", limits = ( 0, Nothing ) })
, associationTo = (LimitedLinking
{ linking = "InstructionSet", limits = ( 0, Just 1 ) })
})
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 4
, referenceUsing = DefiniteArticle
}
}
, Annotation
{ annotated = Right (Composition
{ compositionName = "isComponentOf"
, compositionPart = (LimitedLinking
{ linking = "QuadCoreProcessor", limits = ( 0, Just 1 ) })
, compositionWhole = (LimitedLinking
{ linking = "ComputerSystem", limits = ( 1, Just 1 ) })
})
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 1
, referenceUsing = DefiniteArticle
}
}
, Annotation
{ annotated = Right (Inheritance
{ subClass = "QuadCoreProcessor"
, superClass = "MultiCoreProcessor"
})
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 5
, referenceUsing = DefiniteArticle
}
}
, Annotation
{ annotated = Right (Association
{ associationName = "implements"
, associationFrom = (LimitedLinking
{ linking = "Processor", limits = ( 0, Nothing ) })
, associationTo = (LimitedLinking
{ linking = "InstructionSet", limits = ( 0, Just 1 ) })
})
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 7
, referenceUsing = DefiniteArticle
}
}
, Annotation
{ annotated = Right (Inheritance
{ subClass = "MultiCoreProcessor", superClass = "Processor" })
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 6
, referenceUsing = DefiniteArticle
}
}
, Annotation
{ annotated = Right (Association
{ associationName = "integrates"
, associationFrom = (LimitedLinking
{ linking = "ComputerSystem", limits = ( 0, Nothing ) })
, associationTo = (LimitedLinking
{ linking = "Processor", limits = ( 0, Just 1 ) })
})
, annotation = Relevant
{ contributingToProblem = False
, listingPriority = 3
, referenceUsing = DefiniteArticle
}
}
]
}
, cdDrawSettings = CdDrawSettings
{ omittedDefaults = OmittedDefaultMultiplicities
{ aggregationWholeOmittedDefaultMultiplicity = Just ( 0, Nothing )
, associationOmittedDefaultMultiplicity = Just ( 0, Nothing )
, compositionWholeOmittedDefaultMultiplicity = Nothing
}
, printNames = True
, printNavigations = True
}
, errorReasons = listToFM
[ ( 'a'
, ( False
, Custom (listToFM
[ ( English, "does not have any corresponding object diagram" )
, ( German, "hat gar kein passendes Objektdiagramm" )
])
)
)
, ( 'b'
, ( False
, Custom (listToFM
[ ( English, "violates a requirement of the scenario" )
, ( German, "h\228lt eine Vorgabe des Szenarios nicht ein" )
])
)
)
, ( 'c'
, ( False
, Custom (listToFM
[ ( English, "contains a syntax error" )
, ( German, "enth\228lt einen Syntaxfehler" )
])
)
)
, ( 'd'
, ( True
, Custom (listToFM
[ ( English, "is fully correctly modelled" )
, ( German, "ist vollst\228ndig richtig modelliert" )
])
)
)
]
, showSolution = True
, taskText =
[ Paragraph
[ Translated (listToFM
[ ( English, "A student received the following scenario:" )
, ( German
, "Eine studierende Person hat folgendes Szenario erhalten:"
)
])
]
, Paragraph
[ Translated (listToFM
[ ( English
, "Computer systems, processors, instruction sets, multi-core processors, and quad-core processors are the concepts involved. A multi-core processor is a kind of processor, and a quad-core processor is a kind of multi-core processor. A computer system owns a quad-core processor as a component. Each quad-core processor belongs to exactly one computer system, and each computer system contains at most one quad-core processor. A computer system supports an instruction set. Each computer system supports at most one instruction set, and each instruction set is supported by any number of computer systems. A processor implements an instruction set. Each processor implements at most one instruction set, and each instruction set is implemented by any number of processors. A computer system integrates a processor. Each computer system integrates at most one processor, and each processor is integrated into any number of computer systems."
)
, ( German
, "Die beteiligten Konzepte sind Computersysteme, Prozessoren, Befehlss\228tze, Mehrkernprozessoren und Vierkernprozessoren. Ein Mehrkernprozessor ist ein Prozessor, und ein Vierkernprozessor ist ein Mehrkernprozessor. Ein Computersystem enth\228lt einen Vierkernprozessor als Bestandteil. Jeder Vierkernprozessor geh\246rt zu genau einem Computersystem, und jedes Computersystem enth\228lt h\246chstens einen Vierkernprozessor. Ein Computersystem unterst\252tzt einen Befehlssatz. Jedes Computersystem unterst\252tzt h\246chstens einen Befehlssatz, und jeder Befehlssatz wird von beliebig vielen Computersystemen unterst\252tzt. Ein Prozessor implementiert einen Befehlssatz. Jeder Prozessor implementiert h\246chstens einen Befehlssatz, und jeder Befehlssatz wird von beliebig vielen Prozessoren implementiert. Ein Computersystem integriert einen Prozessor. Jedes Computersystem integriert h\246chstens einen Prozessor, und jeder Prozessor wird in beliebig viele Computersysteme integriert."
)
])
]
, Paragraph
[ Translated (listToFM
[ ( English
, "The student solved the task of creating a class diagram for this scenario in the following way:"
)
, ( German
, "Die Aufgabe, ein Klassendiagramm f\252r dieses Szenario zu erstellen, hat die studierende Person folgenderma\223en gel\246st:"
)
])
]
, Paragraph
[ Special IncorrectCd ]
, Paragraph
[ Translated (listToFM
[ ( English
, "It contains the following relationships between classes:"
)
, ( German
, "Es enth\228lt die folgenden Beziehungen zwischen Klassen:"
)
])
]
, Paragraph
[ Special RelationshipsList ]
, Paragraph
[ Translated (listToFM
[ ( English
, "Decide whether the student's class diagram models the scenario correctly and choose the reason which applies. If the class diagram does not fit the scenario, mention exactly the one relationship which has to be changed so that it fits. Otherwise, mention no relationship."
)
, ( German
, "Entscheiden Sie, ob das Klassendiagramm der studierenden Person das Szenario korrekt modelliert, und w\228hlen Sie den zutreffenden Grund. Falls das Klassendiagramm nicht zum Szenario passt, nennen Sie genau die eine Beziehung, die ge\228ndert werden muss, damit es dem Szenario entspricht. Andernfalls nennen Sie keine Beziehung."
)
])
]
, Paragraph
[ Translated (listToFM
[ ( English, "Reasons available to choose from are:" )
, ( German, "Gr\252nde, die hierf\252r zur Auswahl stehen, sind:" )
])
]
, Paragraph
[ Translated (listToFM
[ ( English, "The class diagram ..." )
, ( German, "Das Klassendiagramm ..." )
])
]
, Paragraph
[ Special ReasonsList ]
]
, addTexts =
[ Static (listToFM
[ ( English, "" )
, ( German
, "Es wird empfohlen, sich (auch) die englische Version des Aufgabentextes anzusehen."
)
])
]
}
The label "supports" on the association between classes ComputerSystem and InstructionSet is not shown correctly.
I found there are some NaN values in the SVG file, so I guess there are some issues during layout. It is likely that the middle section of this relationship is nearly a straight line, which causes the tangent vector to be zero during the calculation at https://github.com/fmidue/modelling-tasks/blob/83adcee8114d4fbb36bcc383600ef89d1c9237b6/src/Modelling/Auxiliary/Diagrams.hs#L546. The subsequent normalization then results in a NaN value.
- Dominant language
- Haskell
- Stars
- 0
- Forks
- 3
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fmidue/modelling-tasks
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
fmidue/modelling-tasks#711 · 1 comment ·
-
bug cd-od testing
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fmidue/modelling-tasks#508 · 4 comments ·
-
Are the "repaired CDs" printed as feedback in `SelectValidCd` guaranteed to be object-inhabited?Opencd-od check required low-priority research
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fmidue/modelling-tasks#705 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fmidue/modelling-tasks#692 ·
-
Find new configOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
fmidue/modelling-tasks#688 · 1 comment ·
All issues in fmidue/modelling-tasks
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Huerte/algo-solutions-python#260 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day