Skip to content

Commit

Permalink
Enhancement: redesign cluster match map (#2437)
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 authored Jul 3, 2023
1 parent acba887 commit 0edb506
Show file tree
Hide file tree
Showing 16 changed files with 510 additions and 316 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/osx_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
branches: [master]
paths-ignore:
- '**/README.md'
pull_request_target:
branches: [master]
paths-ignore:
- '**/README.md'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -23,7 +19,7 @@ jobs:
osx_build:
# The type of runner that the job will run on
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}

env:
GEODA_VER: '1.20.0'
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

name: Ubuntu builds

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
# Triggers the workflow on push only for the master branch
push:
branches: [ master ]
paths-ignore:
- '**/README.md'
pull_request:
branches: [ master ]
branches: [master]
paths-ignore:
- '**/README.md'

Expand All @@ -23,7 +19,7 @@ jobs:
ubuntu_build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}

strategy:
fail-fast: true
Expand All @@ -47,7 +43,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Prepare
# Prepare
- name: Prepare on ${{ matrix.distro }}
run: |
chmod +x BuildTools/ubuntu/install.sh
Expand All @@ -58,14 +54,9 @@ jobs:
# Build GeoDa
- name: Build GeoDa
run: docker run --privileged=true -e CI -e WORK_DIR="$PWD" -e CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt" -e OS=${{ env.TARGET_OS }} -e VER=${{ env.GEODA_VER }} -e APT="apt-get" -v $PWD:$PWD -v /var/run/docker.sock:/var/run/docker.sock ${{ matrix.distro }} $PWD/BuildTools/ubuntu/install.sh

# Upload artifact
- uses: actions/upload-artifact@v2
with:
name: GeoDa-${{ env.GEODA_VER }}-${{ env.TARGET_OS }}
path: ${{ github.workspace }}/BuildTools/ubuntu/geoda_${{ env.GEODA_VER }}-1${{ env.TARGET_OS }}1_amd64.deb





21 changes: 8 additions & 13 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

name: Windows builds

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
branches: [master]
paths-ignore:
- '**/README.md'
pull_request:
branches: [ master ]
branches: [master]
paths-ignore:
- '**/README.md'

Expand All @@ -23,7 +23,7 @@ jobs:
windows_build:
# The type of runner that the job will run on
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}

strategy:
matrix:
Expand All @@ -36,17 +36,17 @@ jobs:
VS_VER: 2019
MSVC_VER: 1920
platform: x86

env:
VS_VERSION: ${{ matrix.VS_VERSION }}
VS_VER: ${{ matrix.VS_VER }}
MSVC_VER: ${{ matrix.MSVC_VER }}
platform: ${{ matrix.platform }}
APPVEYOR: true # to skip some tests
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # see https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

# Steps represent a sequence of tasks that will be executed as part of the job

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
echo ::set-env name=INCLUDE::%INCLUDE%
echo ::set-env name=LIB::%LIB%
echo ::set-env name=LIBPATH::%LIBPATH%
# Build GeoDa
- name: Build
shell: pwsh
Expand Down Expand Up @@ -245,8 +245,3 @@ jobs:
with:
name: GeoDa-Windows7+-${{ env.platform }}-installer
path: ${{ github.workspace }}\BuildTools\windows\GeoDa_1.20_win7+${{ env.platform }}_Setup.exe





17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Mac",
"includePath": ["${workspaceFolder}/**", "/usr/local/opt"],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64"
}
],
"version": 4
}
4 changes: 2 additions & 2 deletions BuildTools/macosx/GeoDa-GDAL-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<key>CFBundleSignature</key>
<string>lgeoda</string>
<key>CFBundleVersion</key>
<string>1.20</string>
<string>1.20.0.46</string>
<key>CFBundleShortVersionString</key>
<string>1.20</string>
<string>1.20.0.46</string>
<key>DTCompiler</key>
<string>4.2</string>
<key>DTPlatformBuild</key>
Expand Down
14 changes: 8 additions & 6 deletions DialogTools/AbstractClusterDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ bool AbstractClusterDlg::CheckMinBound()
void AbstractClusterDlg::InitVariableCombobox(wxListBox* var_box,
bool integer_only, bool add_centroids)
{
combo_var->Clear();
if (combo_var) combo_var->Clear();
var_items.Clear();

std::vector<int> col_id_map;
Expand Down Expand Up @@ -854,11 +854,13 @@ void AbstractClusterDlg::InitVariableCombobox(wxListBox* var_box,
name_to_tm_id["<Y-Centroids>"] = 0;
}

if (!var_items.IsEmpty()) {
var_box->InsertItems(var_items,0);
}
for (int i=0; i<select_vars.size(); i++) {
var_box->SetStringSelection(select_vars[i], true);
if (var_box) {
if (!var_items.IsEmpty()) {
var_box->InsertItems(var_items,0);
}
for (int i=0; i<select_vars.size(); i++) {
var_box->SetStringSelection(select_vars[i], true);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Explore/CatClassification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ void CatClassifData::AppendUndefCategory(int t, int count)
Category c_undef;
c_undef.brush.SetColour(brush_clr);
c_undef.pen.SetColour(pen_clr);
c_undef.label = "undefined";
c_undef.label = GdaConst::map_undefined_category;
c_undef.min_val = 0;
c_undef.max_val = 0;
c_undef.count = count;
Expand Down
11 changes: 6 additions & 5 deletions Explore/CatClassification.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <wx/pen.h>
#include <wx/string.h>
#include "../GenUtils.h"
#include "../GdaConst.h"

struct CatClassifDef;
struct Category;
Expand Down Expand Up @@ -65,15 +66,15 @@ namespace CatClassification {
std::vector<wxString>& cat_labels,
const CatClassifType theme,
bool useScientifcNotation=false,
int cat_disp_precision=3);
int cat_disp_precision=GdaConst::categorical_display_precision);

void SetBreakPoints(std::vector<double>& breaks,
std::vector<wxString>& cat_labels,
const Gda::dbl_int_pair_vec_type& var,
const std::vector<bool>& var_undef,
const CatClassifType theme, int num_cats,
bool useScientificNotation=false,
int cat_disp_precision=3);
int cat_disp_precision=GdaConst::categorical_display_precision);

void PopulateCatClassifData(const CatClassifDef& cat_def,
const std::vector<Gda::dbl_int_pair_vec_type>& var,
Expand All @@ -82,7 +83,7 @@ namespace CatClassification {
std::vector<wxString>& cats_error_message,
bool useSciNotation=false,
bool useUndefinedCategory=true,
int cat_disp_precision=3);
int cat_disp_precision=GdaConst::categorical_display_precision);

void PopulateCatClassifData(const CatClassifDef& cat_def,
const std::vector<Gda::str_int_pair_vec_type>& var,
Expand All @@ -91,7 +92,7 @@ namespace CatClassification {
std::vector<wxString>& cats_error_message,
bool useSciNotation=false,
bool useUndefinedCategory=true,
int cat_disp_precision=3);
int cat_disp_precision=GdaConst::categorical_display_precision);

bool CorrectCatClassifFromTable(CatClassifDef& cc,
TableInterface* table_int,
Expand All @@ -108,7 +109,7 @@ namespace CatClassification {
CatClassifData& cat_data, std::vector<bool>& cats_valid,
ColorScheme coltype=CatClassification::sequential_color_scheme,
bool useSciNotation=false,
int cat_disp_precision=3);
int cat_disp_precision=GdaConst::categorical_display_precision);

ColorScheme GetColSchmForType(CatClassifType theme_type);

Expand Down
Loading

0 comments on commit 0edb506

Please sign in to comment.