Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit bcd681c

Browse files
author
Aaron
authored
Merge pull request #2634 from nijil-binary/smartcharts-update
Nijil/Smartcharts update
2 parents db5586f + d091409 commit bcd681c

File tree

6 files changed

+69
-93
lines changed

6 files changed

+69
-93
lines changed

gulp/bundle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gulp.task(
3131
gulp.task(
3232
'copy-js',
3333
gulp.parallel(done => {
34-
gulp.src(['./node_modules/@binary-com/smartcharts/dist/*.smartcharts.*']).pipe(gulp.dest('www/js/'));
34+
gulp.src(['./node_modules/smartcharts-beta/dist/*.smartcharts.*']).pipe(gulp.dest('www/js/'));
3535
done();
3636
})
3737
);
@@ -41,7 +41,7 @@ gulp.task(
4141
gulp.parallel(done => {
4242
gulp.src([
4343
'node_modules/jquery-ui-css/jquery-ui.min.css',
44-
'./node_modules/@binary-com/smartcharts/dist/smartcharts.css',
44+
'./node_modules/smartcharts-beta/dist/smartcharts.css',
4545
])
4646
.pipe(concatCss('bundle.css'))
4747
.pipe(rev())

package-lock.json

Lines changed: 29 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"webpack-stream": "^4.0.0"
103103
},
104104
"dependencies": {
105-
"@binary-com/smartcharts": "^0.6.1",
105+
"smartcharts-beta": "^0.8.0-betam.10",
106106
"binary-style": "^0.2.4",
107107
"blockly": "github:google/blockly#59e5ac6",
108108
"clone": "aminmarashi/clone#d97b4f",

src/botPage/common/symbolApi/__tests__/activeSymbols.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/botPage/view/Dialogs/Chart.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import {
22
SmartChart,
33
setSmartChartsPublicPath,
4-
ChartTypes,
54
StudyLegend,
65
Views,
7-
Timeperiod,
86
DrawTools,
97
Share,
10-
CrosshairToggle,
11-
ChartSize,
12-
} from '@binary-com/smartcharts';
8+
ChartMode,
9+
} from 'smartcharts-beta';
1310
import React, { PureComponent } from 'react';
1411
import { translate } from '../../../common/i18n';
1512
import Dialog from './Dialog';
@@ -121,14 +118,14 @@ class ChartContent extends PureComponent {
121118

122119
renderControls = () => (
123120
<React.Fragment>
124-
<CrosshairToggle />
125-
<ChartTypes enabled={true} onChange={chartType => this.setState({ chartType })} />
126-
<Timeperiod enabled={true} onChange={granularity => this.setState({ granularity })} />
127-
<StudyLegend />
121+
<ChartMode
122+
onChartType={chartType => this.setState({ chartType })}
123+
onGranularity={granularity => this.setState({ granularity })}
124+
/>
125+
<StudyLegend searchInputClassName="data-hj-whitelist" />
128126
<DrawTools />
129-
<Views />
127+
<Views searchInputClassName="data-hj-whitelist" />
130128
<Share />
131-
<ChartSize />
132129
</React.Fragment>
133130
);
134131

@@ -151,18 +148,18 @@ class ChartContent extends PureComponent {
151148

152149
return (
153150
<SmartChart
154-
id={this.chartId}
151+
barriers={barriers}
152+
chartControlsWidgets={this.renderControls}
155153
chartType={this.state.chartType}
156154
granularity={this.state.granularity}
157-
symbol={this.state.symbol}
158-
isMobile={true}
159-
topWidgets={this.renderTopWidgets}
160-
chartControlsWidgets={this.renderControls}
155+
id={this.chartId}
156+
isMobile={false}
161157
requestAPI={this.requestAPI.bind(this)}
162-
requestSubscribe={this.requestSubscribe.bind(this)}
163158
requestForget={this.requestForget.bind(this)}
164-
barriers={barriers}
159+
requestSubscribe={this.requestSubscribe.bind(this)}
165160
settings={this.settings}
161+
symbol={this.state.symbol}
162+
topWidgets={this.renderTopWidgets}
166163
/>
167164
);
168165
}

static/css/_chart.scss

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,28 @@
1-
.smartcharts-mobile {
2-
font-size: 10px;
1+
.cq-chart-control-bottom .cq-chart-controls .ciq-menu .cq-menu-dropdown.cq-menu-dropdown-enter-done, .cq-chart-control-bottom .cq-chart-controls .ciq-menu .cq-menu-dropdown.cq-menu-dropdown-enter-active {
2+
transform: translateX(-40%) translateY(0em);
3+
}
34

4-
/*
5-
chart controls should still
6-
be visible when its dropdown shows up.
7-
*/
8-
.ciq-period,
9-
.cq-download,
10-
.ciq-views,
11-
.ciq-drawtools,
12-
.ciq-studies,
13-
.cq-chart-setting,
14-
.ciq-draw-tools,
15-
.cq-comparison-new,
16-
.ciq-chart-types {
17-
.cq-menu-overlay {
18-
height: calc(100% - 40px);
19-
}
20-
}
5+
.ciq-list .ciq-list-item {
6+
font-size: 0.8em;
7+
}
218

22-
.cq-modal-dropdown {
23-
position: absolute !important;
9+
.cq-categorical-display {
10+
.cq-item,
11+
.cq-active-item,
12+
.empty-category,
13+
.cq-filter,
14+
.cq-lookup-input>input,
15+
.category-title,
16+
.empty-category {
17+
font-size: 0.8em;
2418
}
25-
26-
.drag-price > .price {
27-
font-size: 10px;
28-
padding: 1px 5px;
19+
.category-title {
20+
font-weight: bold;
2921
}
30-
31-
.ic-icon > svg {
32-
box-sizing: content-box !important;
22+
.empty-category {
23+
padding: 0 0.8em 0.8em;
3324
}
34-
35-
.cq-chart-controls {
36-
.cq-menu-btn > .cq-toggle {
37-
padding: 0.35em 0em !important;
38-
}
39-
40-
.cq-chart-size > :first-child {
41-
margin-right: 2em !important;
42-
}
43-
44-
.ic-icon-with-sub {
45-
&:hover .ic-subtitle {
46-
visibility: visible;
47-
}
48-
.ic-subtitle {
49-
visibility: hidden;
50-
width: 60px;
51-
color: #fff !important;
52-
background: #15212d;
53-
padding: 5px 0;
54-
border-radius: 5px;
55-
position: absolute;
56-
z-index: 1;
57-
bottom: 40px;
58-
left: -15px;
59-
display: block;
60-
margin-bottom: 5px;
61-
}
62-
}
25+
.category.category-has-subtitle {
26+
padding-top: 4em
6327
}
6428
}

0 commit comments

Comments
 (0)