Skip to content

Commit 63f3b03

Browse files
committed
Added material web components
1 parent 5393b0d commit 63f3b03

File tree

5 files changed

+53
-36
lines changed

5 files changed

+53
-36
lines changed

packages/deep-template-analyzer/deep-analyzer-page-summary.js

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {ApolloMutationController} from '@apollo-elements/core';
2-
import {ApolloQuery, html} from '@apollo-elements/lit-apollo';
2+
import {ApolloQuery, css, html} from '@apollo-elements/lit-apollo';
33
import '@google-web-components/google-chart';
4+
import '@material/mwc-button';
5+
import '@material/mwc-textfield';
46
import '@thinkdeep/deep-button/deep-button.mjs';
57
import '@thinkdeep/deep-card/deep-card.mjs';
68
import '@thinkdeep/deep-textbox/deep-textbox.mjs';
@@ -44,37 +46,54 @@ export default class DeepAnalyzerPageSummary extends ApolloQuery {
4446
this.removeEventListener('google-chart-select', this._handleChartSelection);
4547
}
4648

49+
static get styles() {
50+
return css`
51+
:host {
52+
display: block;
53+
min-height: 500px;
54+
}
55+
`;
56+
}
57+
4758
render() {
4859
return html`
4960
${translate('translations:startCollectingLabel')}
50-
<deep-textbox
51-
placeholder="i.e, Google"
61+
<mwc-textfield
62+
label="Business name"
5263
@input="${debounce(this._setCompanyName.bind(this), 350)}"
53-
></deep-textbox>
54-
<deep-button @click="${() => this.mutation.mutate()}"
55-
>${translate('translations:startButtonLabel')}</deep-button
56-
>
57-
58-
<google-chart
59-
type="line"
60-
options='{"title": "Sentiment as a function of time" }'
61-
cols='[{"label": "Timestamp", "type": "number"}, {"label": "Sentiment", "type": "number"}]'
62-
rows="[${this.data?.sentiments?.map((sentiment) =>
63-
JSON.stringify([sentiment.timestamp, sentiment.score])
64-
)}]"
65-
>
66-
</google-chart>
67-
68-
${this.selectedSentiments.map((sentiment) =>
69-
sentiment?.tweets?.map(
70-
(tweet, index) => html`
71-
<deep-card>
72-
<h3>Tweet ${index}</h3>
73-
<p>${tweet?.text}</p>
74-
</deep-card>
75-
`
64+
></mwc-textfield>
65+
<mwc-button
66+
raised
67+
label="${translate('translations:startButtonLabel')}"
68+
@click="${() => this.mutation.mutate()}"
69+
icon="input"
70+
></mwc-button>
71+
72+
<div>
73+
<google-chart
74+
type="line"
75+
options="{&quot;title&quot;: &quot;Sentiment as a function of time&quot; }"
76+
cols="[{&quot;label&quot;: &quot;Timestamp&quot;, &quot;type&quot;: &quot;number&quot;}, {&quot;label&quot;: &quot;Sentiment&quot;, &quot;type&quot;: &quot;number&quot;}]"
77+
rows="[${
78+
this.data?.sentiments?.map((sentiment) =>
79+
JSON.stringify([sentiment.timestamp, sentiment.score])
80+
)
81+
}]"
82+
></google-chart>
83+
</div>
84+
85+
${
86+
this.selectedSentiments.map((sentiment) =>
87+
sentiment?.tweets?.map(
88+
(tweet, index) => html`
89+
<deep-card>
90+
<h3>Tweet ${index}</h3>
91+
<p>${tweet?.text}</p>
92+
</deep-card>
93+
`
94+
)
7695
)
77-
)}
96+
}
7897
`;
7998
}
8099

packages/deep-template-analyzer/deep-template-analyzer.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import '@material/mwc-icon-button';
22
import '@material/mwc-top-app-bar-fixed';
33
import '@thinkdeep/deep-footer';
4-
import '@thinkdeep/deep-navbar';
54
import {Router} from '@vaadin/router';
65
import {css, html, LitElement} from 'lit';
76
import {i18nMixin, translate} from 'lit-element-i18n';
@@ -122,12 +121,14 @@ export class DeepTemplateAnalyzer extends i18nMixin(LitElement) {
122121
background-color: var(--primary-color, #000000);
123122
}
124123
125-
deep-navbar {
124+
mwc-top-app-bar-fixed {
126125
grid-area: header;
127126
height: 16vh;
128127
}
129128
130129
#content {
130+
display: block;
131+
min-height: 500px;
131132
grid-area: content;
132133
}
133134
@@ -142,11 +143,6 @@ export class DeepTemplateAnalyzer extends i18nMixin(LitElement) {
142143
return html`
143144
${this.styles}
144145
145-
<!-- <deep-navbar
146-
class="navbar"
147-
.companyName="${this.companyName}"
148-
.routes="${this.routes}"
149-
></deep-navbar> -->
150146
<mwc-top-app-bar-fixed>
151147
<mwc-icon-button icon="menu" slot="navigationIcon"></mwc-icon-button>
152148

packages/deep-template-analyzer/locales/en-CA/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
headline: 'Explore data.',
1717
buttonText: 'Log In',
1818
notFoundPageContent: 'Page Not Found!',
19-
startCollectingLabel: 'Collect Business Data',
19+
startCollectingLabel: 'Collect Data',
2020
startButtonLabel: 'Start',
2121
selectBusinessLabel: 'Select a business',
2222
};

packages/deep-template-analyzer/locales/en-US/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default {
1414
headline: 'Something different here',
1515
buttonText: 'Log In',
1616
notFoundPageContent: 'Page Still not found!',
17-
startCollectingLabel: 'Collect Business Data2',
17+
startCollectingLabel: 'Collect Data2',
1818
startButtonLabel: 'Start2',
1919
selectBusinessLabel: 'Select a business2',
2020
};

packages/deep-template-analyzer/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
"@apollo-elements/lit-apollo": "^4.1.0",
6969
"@auth0/auth0-spa-js": "^1.19.0",
7070
"@google-web-components/google-chart": "^5.0.0",
71+
"@material/mwc-button": "^0.25.3",
7172
"@material/mwc-icon-button": "^0.25.3",
73+
"@material/mwc-textfield": "^0.25.3",
7274
"@material/mwc-top-app-bar-fixed": "^0.25.3",
7375
"@thinkdeep/deep-button": "^0.0.8",
7476
"@thinkdeep/deep-card": "^0.0.8",

0 commit comments

Comments
 (0)