wp-xyz / corona Goto Github PK
View Code? Open in Web Editor NEWPlots and analyzes daily data of the Covid-19 pandemic
License: MIT License
Plots and analyzes daily data of the Covid-19 pandemic
License: MIT License
Hi there,
This is just something I do for Windows/Linux UX and I don't mind if you ignore me ;)
uses
{...}LCLType,{...}
implementation
procedure MainForm.FormCreate(Sender: TObject);
begin
InitShortCuts;
end;
procedure MainForm.InitShortcuts;
begin
{$IFDEF LINUX}
acFileExit.ShortCut := KeyToShortCut(VK_Q, [ssCtrl]);
{$ENDIF}
{$IFDEF WINDOWS}
acFileExit.ShortCut := KeyToShortCut(VK_X, [ssAlt]);
{$ENDIF}
{ TODO : Implement the equivalent for MacOS }
end;
Cheers,
Gus
P.S.: I've been greeting you with "Hi there" and don't even know your name :-)
Hi there,
If anyone is compiling this on a box that has OpenSSL
1.1 and above but using the stable version of both FPC
(3.0.4) and Lazarus
(2.0.6) and below, they will invariably get a:
ESSL: failed to create ssl context.
This is due to the fact that the OpenSSL
API has changed from 1.0.x to 1.1.x.
I would advise you opt for Synapse
(40.1) that you can install from the Online Package Manager
and instead of the TfpHTTPClient
, use THTTPSend
. This makes it work regardless of the FPC
version on the users computer.
I understand that you want to keep it to a bare minimum and not install external stuff. I've tried to solve this within the code itself and it can't be done. The file on the subject line has to be updated, but it is inside the FPC
distribution, so outside of this code.
This applies, mainly, to Linux users since the latest symlink on the libssl.so
points to libssl.so.1.1
. I'm guessing that any updated Debian-based Linux distribution will have this issue, since the results of a Google search about this error are dated to 2018.
Windows users usually install their own ssl DLLs and avoid this issue.
Thanks in advance,
Gus
Hi there,
As you can see from the image, with large country names, the hint value is truncated when hovering on the graph's data point.
You have StatusPanel[0].Width=300
and StatusPanel[1].Width=50
.
I've tried StatusPanel[0].Width=500
and it works.
Or you could make Panel[1] dynamically expand the remaining width of the StatusBar
and put the hover data point info on it.
Cheers,
Gus
Hey Werner(@wp-xyz),
Sorry to bother with another size issue:
As you can see, the "Cases" Checkbox Group now has a scrollbar.
Cheers,
Gus
Hi Werner(@wp-xyz),
It appears you're not clearing the Hint when you exit a country into an area that doesn't have a country.
Example:
Cheers,
Gus
Hi Werner(@wp-xyz),
Just a reminder to add source/maps/us_counties_map.kml
to the repository, please.
Many thanks!!
Cheers,
Gus
Hi there,
As you can see btnUpdate
and btnClear
are overlapping the TreeView
.
And the MinWidth
for the LeftPanel
is eating up on the text on rgDataType
.
I'm not completely sure that this is your fault, I think Lazarus behaves a bit diff in Windows and Linux in terms of the grid, I think. And I'm not sure I haven't messed with the grid defaults myself.
Shouldn't make any diff, but hey, who knows?!?!?
Could you, please, post an image of how it looks when your first run it? Pls delete corona.cfg
first :)
Many thanks in advance,
Gus
Hey Werner(@wp-xyz),
When I was facepalming while trying to see what you mentioned on #41, I bumped into this sequence:
Then I tried some other stuff and also got abrupt close on this sequence:
Another way of reproducing it:
So, in conclusion, when you turn Date Indicator ON and you select another country, ๐ฃ BOOM ๐ฃ
Here's the heaptrace:
WARNING: TChartListbox.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
WARNING: TTreeView.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
[TGtk2WidgetSet.Destroy] WARNING: There are 1 unreleased DCs, a detailed dump follows:
[TGtk2WidgetSet.Destroy] DCs: 00007F2AA694FC40
[TGtk2WidgetSet.Destroy] WARNING: There are 1 unreleased GDIObjects, a detailed dump follows:
[TGtk2WidgetSet.Destroy] GDIOs: 00007F2AA67AE6C0
[TGtk2WidgetSet.Destroy] gdiBrush: 1
Here's my corona.cfg
:
corona.cfg.zip
Hope it helps!
Cheers,
Gus
Hi there,
Because you have LeftPannel.AutoSize:=True
, LeftSplitter
is unable to budge ;)
Cheers,
Gus
Hey there,
You forgot to git add source/cseries.pas
to one of your commits.
Cheers,
Gus
Hey Werner(@wp-xyz),
There's something not quite right with the overlay of curves, I think.
Please have a look at this video that demonstrates the issue:
Screencast 2021-12-20 05:51:39-Corona.zip
Cheers,
Gus
Hi Werner(@wp-xyz),
If we gonna do it right, might as well include a CONTRIBUTING.md
.
Would you be up to download on of my own and then edit it so that it's good with your style?
That way we can agree on code styling and I don't mess your style.
I also like the Commit Messages section because, later we can automate creating a changes file on the command line.
On my laz-JSON-Viewer: CONTRIBUTING.md
If nothing in there is to your liking, just ditch it.
We will also have to discuss issue templates, but one thing at a time. Well apart from the n balls in the air right now about versioning and the bloody platform diffs in widget, eheheh
Cheers,
Gus
Hi there,
As per commit 0b3ffab the application core dumps, after about 30 to 40 seconds after you press the Update button.
Cheers,
Gus
Hi there,
Your file download function DownloadFile()
returns a boolean that you do not check and blindly update the data files.
I've noticed that the files get truncated to 0 bytes due to Issue #1. But any other network issue could blank the files and the data is gone. The site could be down: github does have had issues before. If someone is on a mobile connection and it fails. And you can imagine some other issues...
Thanks in advance,
Gus
Hey Werner(@wp-xyz),
You've never answered me on this comment, so I'm now making it an issue on it's own for Milestone 1.1(Mapping).
I suggest:
var
DataFolder: String;
begin
{$IFDEF WINDOWS}
DataFolder:= GetUserDir+'CoronaData';
{$ELSE}
DataFolder:= GetUserDir+'.coronadata';
{$ENDIF}
end;
What do you think?
This still leaves the corona.cfg
under Linux:.config/corona.cfg
and Windows:%%APPDATA%%\corona.cfg
or is it %%USER%%\corona.cfg
? Only sure of linux placement. Well what ever GetAppConfigDir()
/ GetAppConfigFile()
returns in Windows.
Cheers,
Gus
Hi there,
This zip: Application_Config_Demo.zip is my boilerplate for any application which I do some config saving.
If you're into the whole "More is Less" refactoring thing, this will cut a fair chunk of your code and it will enable you to add stuff to the config a LOT quicker and seamlessly.
I also introduce you to TPairSplitter
. Once I found this one, I just love it to bits ;)
Cheers,
Gus
Hey @wp-xyz ,
Like I mentioned on one of my comments in #14 my internet connection is really bad, to the point where sometimes even DNS calls fail.
When testing your last fix I ran into DNS fails and the way your dealing with it is a bit lax, sorry for saying it.
I have some suggestions, and they are just suggestions, you can send me packing if you want:
Exception.massage
value on a Message Dialog.except
of your try...except
, increment an error counter and at the end of all files downloaded and if error_count <> 0
just inform user that a download error occurred.
Exception.messages
for each download error and present the user with the files and it's errors. That way, if anyone reports an issue with downloading, you have more info to debug on.I think that's it. Thanks for reading.
Cheers,
Gus
Hey @wp-xyz,
You can find a version of a Modal Form with Download progress bars here:
TestDownloadProgressBar-v1.2.zip
Please take what you want if you think it's any good.
Cheers,
Gus
Hey @wp-xyz,
Under Windows when you click a button on the tool bar, it remains depressed during long operations, like the download (Linux has another animation).
That does not mean that any subsequent click on the button is discarded. It just means that the messages are queued and then processed the next time the main loop can be run.
That means that a nervous user can click more than once on the button if he doesn't spot the messages or the progress bar on the bottom (That was kinda my aim with the Modal Form: a) User cannot miss it; b) Because the operation blocks, with a modal with no buttons, you can't do anything.)
I'm not sure where I picked this code up, but I do this for all my actions:
procedure TfrmMain.ActionSomethingExecute(Sender: TObject);
begin
ActionSomething.Enabled:= False;
{$IFDEF LINUX}
Application.ProcessMessages;
{$ENDIF}
try
try
// Here you put your action code
except
// Always good to have one of these if the code above can generate any
// Exception, right?
on E:Exception do
begin
// Replace this with the appropriate code to deal with an Exception
ShowMessage('Error: ' + E.Message);
end;
end;
finally
// Use of try...finally because something can go wrong and if it does, the button
// would be greyed out until close/open cycle.
ActionSomething.Enabled:= True;
// No need to call ProcessMessages since we exit the action and the
// main loop will catch up
end;
end;
Hope this helps!!
Cheers,
Gus
Hey Werner(@wp-xyz),
As of
367ecd6 (HEAD -> mapping, origin/mapping) Plotting of world map. No connection to Covid data, yet.
Lazarus stable is complaining:
$ lazbuild source/corona.lpi
# ...
/home/gcarreno/Programming/corona/source/cpolygonseries.pas(188,43) Error: (3026) Wrong number of parameters specified for call to "GetLegendItemsRect"
/home/gcarreno/FreePascal_stable/lazarus/components/tachart/lib/x86_64-linux/gtk2/tacustomseries.ppu:tacustomseries.pas(1464,29) Error: (5088) Found declaration: GetLegendItemsRect(TChartLegendItems;TBrush);
cpolygonseries.pas(245) Fatal: (10026) There were 2 errors compiling module, stopping
# ...
Lazarus uses windres
to compile the *.rc
files.
I found i686-w64-mingw32-windres
on Ubuntu package binutils-mingw-w64-i686
.
I installed it and then had to do a ln -s i686-w64-mingw32-windres windres
for lazbuild trunk to compile with success.
I think we should consider .lrs
. It's the same thing and, to be honest, no external dependencies in terms of resource compiler because Lazarus has all the tools to manipulate *.lrs
.
Just my 2ยขs
EDIT: have a look at Lazarus resources
Cheers,
Gus
Hello Werner.
Your program is very useful and didactic.
If it is not too difficult, I would like to have the possibility to set the map tab to fit automatic all the screen (hide the tab and left panel and resize to fit all the screen).
Maybe a button or a key-command to switch map-tab full window without visible tab <> normal with tab visible.
This to use your map for presentation on other screen or with projector.
Fre;D
Hi Werner(@wp-xyz),
I'm not trying to be condescending AT ALL, but I've just noticed that you're using a TIniFile
to save component state and doing all the the thing by hand like:
I hope you are aware of TXMLPropStorage
, TIniPropStorage
and TJSONPropStorage
(I'm rather proud of having done this last one and having it included in the main Lazarus repo ๐)
Once you drop one a those on a form and set the TForm.SessionProprties
, the app takes care of all the read/load/save/write cycle.
And you can even add more stuff via TIniPropStorage.StoredValues
for other config related stuff.
If it's by choice, I would love to hear what's your experience to not using them.
Cheers,
Gus
Hi Werner(@wp-xyz),
It may be my bad eye sight, I have a very crappy varifocal set of glasses and they need to be replaced, but does this colour look good to you on dark mode:
Don't worry about the cropping, I did size the window really small to make the screenshot image small.
Cheers,
Gus
What a useful project!
Surely the most clear and easy to use that I know.
Could it be possible to have also a global result?
I mean for all the planet and by continent?
Thanks.
Fre;D
Hey Werner(@wp-xyz),
Could you please include the maps folder again?
It's probably because I'm at the tail spin of a very long day, but I could swear that the maps were included at some time...
Cheers,
Gus
Hi Werner(@wp-xyz),
I understand that when you created this repo you weren't planning on having someone like me nagging about completeness, but now that I've worked my magic in having you aboard with said completeness, could you address these info issues? (I would do it myself, but I can't change repo stuff)
freepascal
free-pascal
fpc
lazarus
lazarus-ide
covid-19
data
data-science
data-visualization
data-analysis
covid
covid-19
covid-data
This does not affect the release and we can discuss it with time to spare.
Cheers,
Gus
Hey Werner(@wp-xyz),
Found the source I was looking for. I was clever, had it on a private repo on GitHub, ufff.
The only thing I need to suss out now, is how to hook up the download progress.
I'm including source and a i386-win32
cross-compile. Could you test the *.exe
with your virus software? THANKS!!
lazHeidiSQL-UpdateCheck-i386-win32-source.zip
If using WinInet
fools the anti-virus, I have a big fat rewrite ahead of me ๐
Cheers,
Gus
Hi there,
To better manage what I've reported on Issue #8 I suggest the following:
cgCases
, rgDataType
, btnUpdate
and btnClear
inside a TPanel
with Align=alTop
TreeView.Align=alClient
and you can do away with all the Anchors you set up.This way, no overlapping on the buttons and it's all contained.
Again, really sorry if it's too much intruding.
Cheers,
Gus
Hey Werner(@wp-xyz),
The map and the slider effect LOOKS AWESOME!!!
Please keep at it!!!
Cheers,
Gus
Hey Werner (@wp-xyz),
I'm sure that your lack of GIT grasp includes creating tags. That's alright, no problems!
But it would be nice for people to have a pre-compiled binary they could download and run, instead of being savvy enough to download the source and compile it. That would reside on the Release area of GitHub.
On my rig I'm able to compile(Linux-x86_64, Linux-arm[RasPi 3]) and cross-compile(Linux-i386, Win64-x86_64, Win32-i386), and I have enough competence to create an Inno-Setup(GitHub) that can decide to install either a Windows 32b or a Windows 64b version depending on the users platform.
I'm still trying to automate the creation of *.deb
packages with this and I'm not sure I would be inclined to do an *.rpm
.
And finally, also provide a simple *.tar.gz
and *.zip
distribution for those that don't want to commit to a full install.
You can see an example of what I'm suggesting on my lazJSONViewer Releases under the assets. All my suggestions are there, apart from the *.deb
, which I'm still trying to get my head around.
If you agree to this, let me warn you, I may need write access to the repo. I would never mess with the code, because to be quite honest I'm oblivious of the data math/maths you're performing. I would only mess about with a script for Inno-Setup and maybe one to automatically produce the *.zip/*.tar.gz
files.
If you don't want me to have write access to your repo, you could provide a back channel for me to supply the binaries and I can try to help you do the versioning and the tagging. This could also work.
I do not intend to put any pressure on you. If you're not comfortable with any of my suggestions, just brush me off with any excuse, since it's your baby and I don't want to mess with that!!!
Cheers,
Gus
Hey Werner(@wp-xyz),
I'm opening this issue primarily to list the inconsistencies and secondly for us to have a chat about it.
x86_64-linux
:
i386-linux
:
TComboBox
has very squary corners and the rest of the UI is also strange.TProgressBar
, only TLabel
.lazbuild
from trunk, as I'm building with stable 2.0.10 for releases. Maybe I have gremlins somewhere.x86_64-win64
:
i386-win32
:
This is where I'm at.
I have to admit that my cross-compiling now seems to be less healthy than I thought. Maybe need to refresh my stuff with a full install from fpcupdeluxe
on the cross-compile. Don has made some changes quite recently...
Cheers,
Gus
Hey WP (@wp-xyz ),
Just a friendly enquiry to see if you have any idea why the data has stopped being updated as of 8 Mar 2023?
Many thanks in advance!!
Cheers,
Gus
Hey Werner(@wp-xyz)
You have to pay attention to the discussions and the issues. If you don't, after a few days, I'll consider your silence as yes and commit my work.
So what do you think is the code version of what is now in the master branch, before you embarked into branch mapping.
I wanna do a full release of corona before mapping is out.
Cheers,
Gus
Hey Werner(@wp-xyz),
Does is make sense to have a visual representation on the graph of when the map slider is?
I dunno, like a red (or something along a good colour for visual distinctness) vertical line?
Cheers,
Gus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.