Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DTRA]/ Merge flutter chart branch #1472

Merged
merged 20 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
15f2c6c
Bala/Flutter charts integration setup (#1325)
balakrishna-deriv Aug 10, 2023
995636c
Feature adding hover on indicator (#1434)
ahmadtaimoor-deriv Sep 11, 2023
37e6026
Merge branch 'master' of github.com:binary-com/SmartCharts into flutt…
balakrishna-deriv Sep 11, 2023
6b8ff0a
Merge branch 'flutter-chart' of github.com:binary-com/SmartCharts int…
balakrishna-deriv Sep 11, 2023
5137b3d
Add turbos contract type drawings (#1435)
balakrishna-deriv Sep 26, 2023
765f753
Feat drawing tool integration (#1443)
ahmadtaimoor-deriv Oct 6, 2023
e03e31f
Merge branch 'master' of github.com:binary-com/SmartCharts into flutt…
balakrishna-deriv Oct 6, 2023
09a13be
Bala/Html renderer and performance improvement (#1452)
balakrishna-deriv Oct 17, 2023
ddab405
fix indicator deletion on interval (#1454)
ahmadtaimoor-deriv Oct 18, 2023
f41f22a
flutter charts bug fixes (#1455)
balakrishna-deriv Oct 24, 2023
8ce404a
Ahmad/FEQ-948/Update Candle Color (#1460)
ahmadtaimoor-deriv Nov 30, 2023
7acf317
[DTRA]Ahmad/FEQ-960/Strike Price movement with marker barrier and Pri…
ahmadtaimoor-deriv Dec 1, 2023
75c0d46
chore: add portuguese language into SmartCharts (#1457)
suisin-deriv Nov 21, 2023
f22b05d
chore: update package version
balakrishna-deriv Dec 5, 2023
4d94d6d
Akmal / feat: implement new blue barrier in flutter charts (#1462)
akmal-deriv Dec 7, 2023
60b6cb1
[Dtra] Fix perf (#1466)
balakrishna-deriv Dec 19, 2023
05bd2d0
[DTRA] Fix trackjs issue (#1468)
balakrishna-deriv Dec 22, 2023
054f6d5
[DTRA] Bala/Fix scaling issue (#1469)
balakrishna-deriv Dec 29, 2023
86f85a0
chore: update version 2.0.0 (#1471)
balakrishna-deriv Dec 29, 2023
9aa0944
Merge branch 'master' of github.com:binary-com/SmartCharts into flutt…
balakrishna-deriv Dec 29, 2023
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist
chartiq
node_modules
design
/**/*.d.ts
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"allowChildren": false
}
],
"react/require-default-props": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-var-requires": "off"
}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ jsconfig.json
CNAME
.nyc_output
**/*.swp

chart_app/build/**
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.eslintrc
.tern-project
.travis.yml
chartiq/
chart_app/
crowdin.yml
css/
design-v1.js
Expand Down
225 changes: 139 additions & 86 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,88 +1,141 @@
{
"plugins": [
"stylelint-no-unsupported-browser-features"
],
"rules": {
"at-rule-name-case" : "lower",
"at-rule-name-space-after" : "always",
"at-rule-semicolon-newline-after" : "always",
"block-closing-brace-newline-after" : "always",
"block-closing-brace-newline-before" : "always",
"block-no-empty" : true,
"block-opening-brace-newline-after" : "always",
"block-opening-brace-space-before" : "always",
"color-hex-case" : "lower",
"color-named" : "never",
"color-no-invalid-hex" : true,
"declaration-bang-space-after" : "never",
"declaration-bang-space-before" : "always",
"declaration-block-no-duplicate-properties" : [true, { "ignore": ["consecutive-duplicates"] }],
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after" : "always",
"declaration-block-semicolon-newline-before" : "never-multi-line",
"declaration-block-semicolon-space-after" : "always-single-line",
"declaration-block-semicolon-space-before" : "never",
"declaration-block-trailing-semicolon" : "always",
"declaration-colon-space-after" : "always",
"declaration-colon-space-before" : "never",
"font-family-name-quotes" : "always-unless-keyword",
"function-calc-no-unspaced-operator" : true,
"function-comma-space-after" : "always",
"function-comma-space-before" : "never",
"function-name-case" : "lower",
"function-parentheses-space-inside" : "never",
"function-url-quotes" : "always",
"indentation" : 4,
"max-empty-lines" : 1,
"media-feature-colon-space-after" : "always",
"media-feature-colon-space-before" : "never",
"media-feature-range-operator-space-after" : "always",
"media-feature-range-operator-space-before" : "always",
"media-query-list-comma-newline-after" : "never-multi-line",
"media-query-list-comma-newline-before" : "never-multi-line",
"media-query-list-comma-space-after" : "always",
"media-query-list-comma-space-before" : "never",
"no-duplicate-selectors" : true,
"no-eol-whitespace" : true,
"no-extra-semicolons" : true,
"no-invalid-double-slash-comments" : true,
"number-leading-zero" : "always",
"number-max-precision" : 2,
"number-no-trailing-zeros" : true,
"property-case" : "lower",
"plugin/no-unsupported-browser-features" : [true, {
"severity": "error",
"ignore": ["calc", "user-select-none", "multicolumn", "css-appearance", "intrinsic-width"]
}],
"rule-empty-line-before" : ["always", { "ignore": ["after-comment"], "except": ["inside-block-and-after-rule", "first-nested"] }],
"selector-attribute-brackets-space-inside" : "never",
"selector-attribute-operator-space-after" : "never",
"selector-attribute-operator-space-before" : "never",
"selector-combinator-space-after" : "always",
"selector-combinator-space-before" : "always",
"selector-list-comma-newline-before" : "never-multi-line",
"selector-list-comma-space-before" : "never",
"selector-max-empty-lines" : 0,
"selector-pseudo-class-case" : "lower",
"selector-pseudo-class-no-unknown" : [true, {
"ignorePseudoClasses": ["export"]
}],
"selector-pseudo-class-parentheses-space-inside" : "never",
"selector-pseudo-element-case" : "lower",
"selector-pseudo-element-colon-notation" : "single",
"selector-pseudo-element-no-unknown" : true,
"selector-type-case" : "lower",
"selector-type-no-unknown" : [true, { "ignoreTypes": ["from", "to", "0%", "50%", "100%", "_"] }],
"shorthand-property-no-redundant-values" : true,
"string-no-newline" : true,
"string-quotes" : "single",
"time-min-milliseconds" : 100,
"unit-case" : "lower",
"unit-whitelist" : ["fr", "px", "em", "rem", "%", "vw", "vh", "deg", "ms", "s"],
"value-keyword-case" : "lower",
"value-list-comma-newline-after" : "never-multi-line",
"value-list-comma-newline-before" : "never-multi-line",
"value-list-comma-space-after" : "always",
"value-list-comma-space-before" : "never"
}
"plugins": [
"stylelint-no-unsupported-browser-features"
],
"rules": {
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always",
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-before": "always",
"color-hex-case": "lower",
"color-named": "never",
"color-no-invalid-hex": true,
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": [
true,
{
"ignore": [
"consecutive-duplicates"
]
}
],
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-trailing-semicolon": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"font-family-name-quotes": "always-unless-keyword",
"function-calc-no-unspaced-operator": true,
"function-comma-space-before": "never",
"function-name-case": "lower",
"function-url-quotes": "always",
"indentation": 4,
"max-empty-lines": 1,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "never-multi-line",
"media-query-list-comma-newline-before": "never-multi-line",
"media-query-list-comma-space-after": "always",
"media-query-list-comma-space-before": "never",
"no-duplicate-selectors": true,
"no-eol-whitespace": true,
"no-extra-semicolons": true,
"no-invalid-double-slash-comments": true,
"number-leading-zero": "always",
"number-max-precision": 2,
"number-no-trailing-zeros": true,
"property-case": "lower",
"plugin/no-unsupported-browser-features": [
true,
{
"severity": "error",
"ignore": [
"calc",
"user-select-none",
"multicolumn",
"css-appearance",
"intrinsic-width"
]
}
],
"rule-empty-line-before": [
"always",
{
"ignore": [
"after-comment"
],
"except": [
"inside-block-and-after-rule",
"first-nested"
]
}
],
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": [
"export"
]
}
],
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "single",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": [
true,
{
"ignoreTypes": [
"from",
"to",
"0%",
"50%",
"100%",
"_"
]
}
],
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"string-quotes": "single",
"time-min-milliseconds": 100,
"unit-case": "lower",
"unit-whitelist": [
"fr",
"px",
"em",
"rem",
"%",
"vw",
"vh",
"deg",
"ms",
"s"
],
"value-keyword-case": "lower",
"value-list-comma-newline-after": "never-multi-line",
"value-list-comma-newline-before": "never-multi-line",
"value-list-comma-space-after": "always",
"value-list-comma-space-before": "never"
}
}
34 changes: 17 additions & 17 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="referrer" content="origin" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" />
<meta
name="description"
content="Analyse the financial markets using beautiful visualisations and unique trading tools, powered by a fast and intuitive interface."
/>
<link rel="stylesheet" type="text/css" href="./dist/smartcharts.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./dist/styles.css" media="screen" />
<title>Library Test</title>
</head>

<head>
<meta charset="utf-8" />
<meta name="referrer" content="origin">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="Analyse the financial markets using beautiful visualisations and unique trading tools, powered by a fast and intuitive interface." />
<link rel="stylesheet" type="text/css" href="./dist/smartcharts.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./dist/styles.css" media="screen" />
<title>Library Test</title>
</head>

<body>
<div id="root"></div>
<script src="./dist/chartiq.min.js"></script>
<script src="./dist/app.js"></script>
</body>

<body>
<div id="root"></div>
<script src="./dist/app.js"></script>
</body>
</html>
15 changes: 10 additions & 5 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ const App = () => {
const memoizedValues = React.useMemo(() => {
let endEpoch: number | undefined,
granularity: number | undefined,
chartType = '';
chartType = '',
symbol = '';
if (settingsRef.current.historical) {
endEpoch = new Date(`${today}:00Z`).valueOf() / 1000;
chartType = 'mountain';
chartType = 'line';
granularity = 0;
if (layout) {
granularity =
Expand All @@ -153,25 +154,27 @@ const App = () => {
(layout.interval * IntervalEnum[layout.timeUnit as keyof typeof IntervalEnum]).toString(),
10
); // eslint-disable-line
if (layout.chartType === 'candle' && layout.aggregationType !== 'ohlc') {
if (layout.chartType === 'candles' && layout.aggregationType !== 'ohlc') {
chartType = layout.aggregationType;
} else {
chartType = layout.chartType;
}
symbol = layout.symbol;
}
}
return {
chartType,
granularity,
endEpoch,
symbol,
};
}, [layout]);
const [chartType, setChartType] = React.useState<string | undefined>(memoizedValues.chartType);
const [granularity, setGranularity] = React.useState<TGranularity>(memoizedValues.granularity as TGranularity);
const [endEpoch, setEndEpoch] = React.useState(memoizedValues.endEpoch);
const [isConnectionOpened, setIsConnectionOpened] = React.useState(true);
const [networkStatus, setNetworkStatus] = React.useState<TNetworkConfig>();
const [symbol, setSymbol] = React.useState<string>('');
const [symbol, setSymbol] = React.useState<string>(memoizedValues.symbol);
const allTicks: keyof AuditDetailsForExpiredContract | [] = [];
const contractInfo: keyof ProposalOpenContract | {} = {};
React.useEffect(() => {
Expand All @@ -192,7 +195,7 @@ const App = () => {
console.log('settings updated:', newSettings);
localStorage.setItem('smartchart-setting', JSON.stringify(newSettings));
if (!prevSetting.historical && newSettings.historical) {
setChartType('mountain');
setChartType('line');
setGranularity(0);
setEndEpoch(new Date(`${today}:00Z`).valueOf() / 1000);
} else if (!newSettings.historical) {
Expand Down Expand Up @@ -252,6 +255,7 @@ const App = () => {
});
}
};

return (
<SmartChart
id={chartId}
Expand All @@ -278,6 +282,7 @@ const App = () => {
networkStatus={networkStatus}
shouldFetchTradingTimes
shouldFetchTickHistory
isLive
enabledChartFooter
allTicks={allTicks}
contractInfo={contractInfo}
Expand Down
Loading
Loading