Skip to content

Commit

Permalink
Prevent SymbolDefinitions from effecting the layout of the resolver g…
Browse files Browse the repository at this point in the history
…raph
  • Loading branch information
oatkiller committed Mar 30, 2020
1 parent 90771d8 commit e686039
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
euiPaletteForStatus,
colorPalette,
} from '@elastic/eui';
import styled from 'styled-components';

/**
* Generating from `colorPalette` function: This could potentially
Expand Down Expand Up @@ -396,17 +397,25 @@ const SymbolsAndShapes = memo(() => (
));

/**
* This <defs> element is used to define the reusable assets for the Resolver
* It confers sevral advantages, including but not limited to:
* 1) Freedom of form for creative assets (beyond box-model constraints)
* 2) Separation of concerns between creative assets and more functional areas of the app
* 3) <use> elements can be handled by compositor (faster)
* This `<defs>` element is used to define the reusable assets for the Resolver
* It confers several advantages, including but not limited to:
* 1. Freedom of form for creative assets (beyond box-model constraints)
* 2. Separation of concerns between creative assets and more functional areas of the app
* 3. `<use>` elements can be handled by compositor (faster)
*/
export const SymbolDefinitions = memo(() => (
<svg>
<defs>
<PaintServers />
<SymbolsAndShapes />
</defs>
</svg>
));
export const SymbolDefinitions = styled(
memo(({ className }: { className?: string }) => (
<svg className={className}>
<defs>
<PaintServers />
<SymbolsAndShapes />
</defs>
</svg>
))
)`
position: absolute;
left: 100%;
top: 100%;
width: 0;
height: 0;
`;

0 comments on commit e686039

Please sign in to comment.