-
Notifications
You must be signed in to change notification settings - Fork 23
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
Tradingview chart #2463
Tradingview chart #2463
Conversation
Nice. Doesn't look too sexy though 😬 I tried it on an iOS simulator and it looks even worse :/ |
@Restioson can you configure the widget to open in the browser if the TradingView logo is tapped? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could get rid of the in widget browser "feature" and instead open the browser on the phone it would be good to go.
Note, I haven't run it on my machine. We should check if it's properly rendered for iOS and Android.
Additionally it would be cool to recognise if the user is tilting their phone. If so we could show more details on the trading view. But that doesn't have to come with this PR.
@@ -204,7 +204,7 @@ wipe: wipe-docker wipe-coordinator wipe-maker wipe-app wipe-webapp | |||
wipe-docker: | |||
#!/usr/bin/env bash | |||
set -euxo pipefail | |||
docker-compose down -v | |||
docker compose down -v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear this will break it for me since I did not install compose as plugin but as separate binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can drop this commit if we want but it'd be good to find a solution that works for both of us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to change my setup if it's fine for everybody else @bonomat @luckysori
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no hard feelings, on my machine both seems to work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this change.
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async> | ||
{ | ||
"autosize": true, | ||
"symbol": "BITSTAMP:BTCUSD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 can we change that to BitMEX?
<!-- TradingView Widget BEGIN --> | ||
<div class="tradingview-widget-container" style="height:100%;width:100%"> | ||
<div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div> | ||
<div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank"><span class="blue-text">Track all markets on TradingView</span></a></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 I guess we can remove that link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but I'm not sure if we would be violating some usage policy by doing that
"allow_symbol_change": false, | ||
"save_image": false, | ||
"calendar": false, | ||
"support_host": "https://www.tradingview.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ what is the support host?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was generated by the widget creator on their site
I believe it's a scaling issue. The photo that I sent looks poor because it's a JPEG. It's perfectly crisp on my phone screen but the artifacts look really bad when cropped & zoomed like that. As we've discussed with iOS it seems like the scaling algorithm isn't great for the simulator and possibly real phone too. I'm not exactly sure how we should be scaling it. Maybe there's some viewport meta tags that can be provided to specify DPI? I will have to try these out.
I can give it a shot for sure!
How do you mean - get rid of it entirely and just show a link? If we will do this, we could also use the mini ticker view and have a tap for details feature. That way there is still something to show, especially just the price and recent movements, but it won't be scrollable.
Do we still want to go with TradingView if we will have ads like this? 😕 |
I meant If we can get rid of the widget opening another website internally, when clicking the TradingView logo. I think this will also fix the ad issue. |
Do you know anything about how the ads are showing up? I haven't had it happen yet and was assuming that it just replaced the old view (i.e without having to navigate to a new site or anything) |
I've added the functionality to only open links in a new tab in the latest commit |
My theory is that the widget simply shows the tradingview.com website and that the ad is simply coming from there. |
yea, I think the ad only came because I clicked on the trading view tab which opened trading view. |
I'm not sure we can remove the grey border, as it's inside the iframe. Same goes for the reset control. We should be able to change it to a line graph and also could edit the timezone, though. Are these features desired? |
With regards to the grey border, it's not a big deal. |
I've tested it on an iPhone simulator... unfortunately it doesn't work. ..setNavigationDelegate(NavigationDelegate(
onNavigationRequest: (req) async {
final uri = Uri.parse(req.url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
showSnackBar(ScaffoldMessenger.of(rootNavigatorKey.currentContext!),
"Failed to open link to TradingView");
}
return NavigationDecision.prevent;
},
)) it looks like the requested URL is |
When you say 'works', do you mean that it launches into a new browser app, or that it redirects the embedded page in the app? Also, can you see the page fine? Is the external launching the only issue? |
Sorry, what I meant is that I don't see a chart at all. Only if I remove said code part I see the chart. |
Hmm, I see. I'll maybe add an exception for about scheme urls and we can see if that works? Are you happy to test this? |
Unfortunately it doesn't work on my simulator. When navigating to the trade screen it automatically opens the external browser and opens the tradingview. It only works if I remove the |
Made it work for you in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally on Android and iOS simulator. I failed deploying it on the phone due to some local setting issue though, but I think we should give it a try.
This allows it to work for me. Otherwise, I get a command not found error
@Restioson : I've rebased for you. Let's get this in. |
this is also needed so that our tests run, which run on native
Fixes #2123
I'm not sure that this will work well at all DPIs - I add a 3x scale, else it is too small
TODO: