Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

[bug] fix bug with p-value cut off in windows chrome #2549

Merged
merged 1 commit into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/packages/@ncigdc/components/SurvivalPlotWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const colors = scaleOrdinal(schemeCategory10);
const styles = {
pValue: {
fontSize: '1.1rem',
height: '1.5rem',
lineHeight: '1.5rem',
marginTop: '0.5rem',
textAlign: 'center',
},
Expand Down Expand Up @@ -221,7 +221,7 @@ const SurvivalPlotWrapper = ({
<br />
the precision inherent in the code
</div>
)
)
}
>
<div className="p-value">
Expand Down Expand Up @@ -289,7 +289,7 @@ function renderSurvivalPlot(props: TProps): void {
onMouseEnterDonor: (
e,
{
survivalEstimate, time = 0, censored, submitter_id, project_id,
censored, project_id, submitter_id, survivalEstimate, time = 0,
}
) => {
setTooltip(
Expand Down
24 changes: 12 additions & 12 deletions src/packages/@ncigdc/utils/wrapSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function buildForeignObject({
}): { html: string, height: number } {
const foreignObjects = elements.filter(Boolean);
// $FlowIgnore
const elementsHeight = sum(foreignObjects.map(e => e.offsetHeight || 15));
Copy link
Contributor Author

@samrichca samrichca May 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increase p-value height
increase all undefined heights a little bit

const elementsHeight = sum(foreignObjects.map(e => (e.className === 'p-value' ? 25 : e.offsetHeight || 17)));

return {
height: elementsHeight,
Expand Down Expand Up @@ -175,10 +175,10 @@ const wrapSvg = ({
22,
])}"
viewBox="0 0 ${width} ${sum([
height,
afterObject.height,
22,
])}"
height,
afterObject.height,
22,
])}"
style="font-size: 10px"
class="${EXPORT_CLASS} ${svgClass || ''} ${className}"
>
Expand All @@ -191,14 +191,14 @@ const wrapSvg = ({
${beforeObject.html}
${rightObject.html}
<g transform="translate(${margins.left || 0},${sum([
titleHeight,
margins.top,
beforeObject.height,
])})">
titleHeight,
margins.top,
beforeObject.height,
])})">
${svg.innerHTML.replace(
/url\(['"]?https?:\/\/[^#]+(#.+)['"]?\)/g,
'url($1)',
)}
/url\(['"]?https?:\/\/[^#]+(#.+)['"]?\)/g,
'url($1)',
)}
</g>
${afterObject.html}
${legends
Expand Down