Skip to content

Commit

Permalink
adjust explorer chart color and spacing (opensearch-project#1051)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Sebastian <paulstn@amazon.com>
  • Loading branch information
paulstn authored and derek-ho committed Oct 4, 2023
1 parent b5ad24f commit 45a92f2
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 135 deletions.
2 changes: 1 addition & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const SAVED_OBJECT = '/object';
// Color Constants
export const PLOTLY_COLOR = [
'#3CA1C7',
'#8C55A3',
'#54B399',
'#DB748A',
'#F2BE4B',
'#68CCC2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"barmode": "group",
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -1495,7 +1495,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = `
"barmode": "group",
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -2036,7 +2036,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -2552,7 +2552,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -3082,7 +3082,7 @@ exports[`Utils helper functions renders displayVisualization function 2`] = `
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -4726,7 +4726,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
"barmode": "group",
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -4819,7 +4819,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = `
"barmode": "group",
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down
200 changes: 102 additions & 98 deletions public/components/event_analytics/explorer/explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiHorizontalRule,
EuiLink,
EuiLoadingSpinner,
EuiPanel,
EuiSpacer,
EuiTabbedContent,
EuiTabbedContentTab,
Expand Down Expand Up @@ -506,108 +507,111 @@ export const Explorer = ({
</div>
<div className={`dscWrapper ${mainSectionClassName}`}>
{explorerData && !isEmpty(explorerData.jsonData) ? (
<div className="dscWrapper__content">
<div className="dscResults">
{countDistribution?.data && !isLiveTailOnRef.current && (
<>
<HitsCounter
hits={_.sum(countDistribution.data['count()'])}
showResetButton={false}
onResetQuery={() => {}}
/>
<TimechartHeader
options={timeIntervalOptions}
onChangeInterval={(selectedIntrv) => {
const intervalOptionsIndex = timeIntervalOptions.findIndex(
(item) => item.value === selectedIntrv
);
const intrv = selectedIntrv.replace(/^auto_/, '');
getCountVisualizations(intrv);
selectedIntervalRef.current = timeIntervalOptions[intervalOptionsIndex];
getPatterns(intrv, getErrorHandler('Error fetching patterns'));
}}
stateInterval={selectedIntervalRef.current?.value}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
<CountDistribution
countDistribution={countDistribution}
selectedInterval={selectedIntervalRef.current?.value}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
<EuiHorizontalRule margin="xs" />
<LogPatterns
selectedIntervalUnit={selectedIntervalRef.current}
handleTimeRangePickerRefresh={handleTimeRangePickerRefresh}
/>
</>
)}

<section
className="dscTable dscTableFixedScroll"
aria-labelledby="documentsAriaLabel"
>
<h2 className="euiScreenReaderOnly" id="documentsAriaLabel">
<FormattedMessage id="discover.documentsAriaLabel" defaultMessage="Documents" />
</h2>
<div className="dscDiscover">
{isLiveTailOnRef.current && (
<EuiFlexGroup direction="column" gutterSize="none">
<EuiFlexItem grow={false}>
<EuiPanel hasBorder={false} hasShadow={false} paddingSize="s" color="transparent">
<EuiPanel paddingSize="s" style={{ height: '100%' }}>
{countDistribution?.data && !isLiveTailOnRef.current && (
<>
<EuiSpacer size="m" />
<EuiFlexGroup justifyContent="center" alignItems="center" gutterSize="m">
<EuiLoadingSpinner size="l" />
<EuiText textAlign="center" data-test-subj="LiveStreamIndicator_on">
<strong>&nbsp;&nbsp;Live streaming</strong>
</EuiText>
<EuiFlexItem grow={false}>
<HitsCounter
hits={totalHits}
showResetButton={false}
onResetQuery={() => {}}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>since {liveTimestamp}</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
<HitsCounter
hits={_.sum(countDistribution.data['count()'])}
showResetButton={false}
onResetQuery={() => {}}
/>
<TimechartHeader
options={timeIntervalOptions}
onChangeInterval={(selectedIntrv) => {
const intervalOptionsIndex = timeIntervalOptions.findIndex(
(item) => item.value === selectedIntrv
);
const intrv = selectedIntrv.replace(/^auto_/, '');
getCountVisualizations(intrv);
selectedIntervalRef.current = timeIntervalOptions[intervalOptionsIndex];
getPatterns(intrv, getErrorHandler('Error fetching patterns'));
}}
stateInterval={selectedIntervalRef.current?.value}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
<CountDistribution
countDistribution={countDistribution}
selectedInterval={selectedIntervalRef.current?.value}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
</>
)}
{countDistribution?.data && (
<EuiTitle size="s">
<h3 style={{ margin: '0px', textAlign: 'left', marginLeft: '10px' }}>
Events
<span className="event-header-count">
{' '}
(
{reduce(
countDistribution.data['count()'],
(sum, n) => {
return sum + n;
},
0
)}
)
</span>
</h3>
</EuiTitle>
)}
<EuiHorizontalRule margin="xs" />
<DataGrid
http={http}
pplService={pplService}
rows={explorerData.jsonData}
rowsAll={explorerData.jsonDataAll}
explorerFields={explorerFields}
timeStampField={queryRef.current![SELECTED_TIMESTAMP]}
rawQuery={appBasedRef.current || queryRef.current![RAW_QUERY]}
</EuiPanel>
</EuiPanel>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiPanel hasBorder={false} hasShadow={false} paddingSize="s" color="transparent">
<EuiPanel paddingSize="s" style={{ height: '100%' }}>
<LogPatterns
selectedIntervalUnit={selectedIntervalRef.current}
handleTimeRangePickerRefresh={handleTimeRangePickerRefresh}
/>
<a tabIndex={0} id="discoverBottomMarker">
&#8203;
</a>
</div>
</section>
</div>
</div>
</EuiPanel>
</EuiPanel>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiPanel hasBorder={false} hasShadow={false} paddingSize="s" color="transparent">
<EuiPanel paddingSize="s" style={{ height: '100%' }}>
<section
className="dscTable dscTableFixedScroll"
aria-labelledby="documentsAriaLabel"
>
<h2 className="euiScreenReaderOnly" id="documentsAriaLabel">
<FormattedMessage
id="discover.documentsAriaLabel"
defaultMessage="Documents"
/>
</h2>
<div className="dscDiscover">
{isLiveTailOnRef.current && (
<>
<EuiSpacer size="m" />
<EuiFlexGroup
justifyContent="center"
alignItems="center"
gutterSize="m"
>
<EuiLoadingSpinner size="l" />
<EuiText textAlign="center" data-test-subj="LiveStreamIndicator_on">
<strong>&nbsp;&nbsp;Live streaming</strong>
</EuiText>
<EuiFlexItem grow={false}>
<HitsCounter
hits={totalHits}
showResetButton={false}
onResetQuery={() => {}}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>since {liveTimestamp}</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
</>
)}
<DataGrid
http={http}
pplService={pplService}
rows={explorerData.jsonData}
rowsAll={explorerData.jsonDataAll}
explorerFields={explorerFields}
timeStampField={queryRef.current![SELECTED_TIMESTAMP]}
rawQuery={appBasedRef.current || queryRef.current![RAW_QUERY]}
/>
<a tabIndex={0} id="discoverBottomMarker">
&#8203;
</a>
</div>
</section>
</EuiPanel>
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
) : (
<NoResults />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ exports[`Config panel component Renders config panel with visualization data 1`]
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -1814,7 +1814,7 @@ exports[`Config panel component Renders config panel with visualization data 1`]
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down Expand Up @@ -2312,7 +2312,7 @@ exports[`Config panel component Renders config panel with visualization data 1`]
"layout": Object {
"colorway": Array [
"#3CA1C7",
"#8C55A3",
"#54B399",
"#DB748A",
"#F2BE4B",
"#68CCC2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Veritcal Bar component Renders veritcal bar component 1`] = `
layout={
Object {
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"margin": Object {
Expand Down Expand Up @@ -691,7 +691,7 @@ exports[`Veritcal Bar component Renders veritcal bar component 1`] = `
"bargroupgap": 0.030000000000000027,
"barmode": "group",
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"hovermode": "closest",
Expand Down Expand Up @@ -749,7 +749,7 @@ exports[`Veritcal Bar component Renders veritcal bar component 1`] = `
"bargroupgap": 0.030000000000000027,
"barmode": "group",
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"hovermode": "closest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Gauge component Renders gauge component 1`] = `
layout={
Object {
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"margin": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Heatmap component Renders heatmap component 1`] = `
layout={
Object {
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"margin": Object {
Expand Down Expand Up @@ -703,7 +703,7 @@ exports[`Heatmap component Renders heatmap component 1`] = `
layout={
Object {
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"margin": Object {
Expand Down Expand Up @@ -756,7 +756,7 @@ exports[`Heatmap component Renders heatmap component 1`] = `
"autosize": true,
"barmode": "stack",
"colorway": Array [
"#8C55A3",
"#54B399",
],
"height": 220,
"hovermode": "closest",
Expand Down
Loading

0 comments on commit 45a92f2

Please sign in to comment.