Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/RaylockLLC/DearPyGui
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Aug 12, 2020
2 parents 2e0cf0e + e95569f commit 9f5ae10
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CONFIG_32BIT ${CONFIG_32BIT})
set(MVDIST_ONLY ${MVDIST_ONLY})

add_definitions(-D_USE_MATH_DEFINES)
add_definitions(-DMV_SANDBOX_VERSION="0.1.0b1")
add_definitions(-DMV_SANDBOX_VERSION="0.1.0b2")

# Include sub-projects.
add_subdirectory ("DearPyGui")
Expand Down
7 changes: 5 additions & 2 deletions DearPyGui/src/Core/AppItems/mvPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace Marvel {
series->draw();


ImPlot::SetColormap(ImPlotColormap_Default);
//ImPlot::SetColormap(ImPlotColormap_Default);

m_queried = ImPlot::IsPlotQueried();

Expand Down Expand Up @@ -213,7 +213,10 @@ namespace Marvel {

ImPlot::PushStyleVar(ImPlotStyleVar_LineWeight, m_lineWeight);

ImPlot::PlotLine(m_name.c_str(), m_xs.data(), m_ys.data(), m_xs.size());
if (m_fill.specified)
ImPlot::PlotShaded(m_name.c_str(), m_xs.data(), m_ys.data(), m_xs.size());
else
ImPlot::PlotLine(m_name.c_str(), m_xs.data(), m_ys.data(), m_xs.size());

if (m_color.specified)
ImPlot::PopStyleColor();
Expand Down
122 changes: 97 additions & 25 deletions DearPyGui/src/Core/AppItems/mvTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,42 @@ namespace Marvel {
{
m_headers.push_back(name);

int index = 0;
for (auto& row : m_values)
if (column.size() > m_values.size())
{
if (index >= column.size())
for (unsigned i = 0; i < column.size(); i++)
{
row.emplace_back("");
index++;
continue;
// row exists
if (i < m_values.size())
{
m_values[i].emplace_back(column[i]);
continue;
}

// row does not exist
m_values.push_back({});
for (unsigned j = 0; j < m_headers.size() - 1; j++)
m_values[i].emplace_back("");

m_values[i].emplace_back(column[i]);
}
}

row.push_back(column[index]);
index++;
else
{
int index = 0;
for (auto& row : m_values)
{
if (index >= column.size())
{
row.emplace_back("");
index++;
continue;

}

row.push_back(column[index]);
index++;
}
}

m_columns++;
Expand Down Expand Up @@ -193,30 +216,79 @@ namespace Marvel {
m_headers.push_back(oldHeaders[i - 1]);
}

for (size_t i = 0; i < oldValues.size(); i++)
if (column.size() > oldValues.size())
{
std::vector<std::string> row;
for (int j = 0; j < oldHeaders.size(); j++)
for (size_t i = 0; i < column.size(); i++)
{
if (j == column_index)
if (i < oldValues.size())
{
if (i >= column.size())
row.emplace_back("");
else
row.push_back(column[i]);
continue;
}
std::vector<std::string> row;
for (size_t j = 0; j < oldHeaders.size(); j++)
{
if (j == column_index)
{
row.push_back(column[i]);
continue;
}

if (j > column_index)
row.push_back(oldValues[i][j - 1]);
if (j > column_index)
row.push_back(oldValues[i][j - 1]);

else
row.push_back(oldValues[i][j]);
else
row.push_back(oldValues[i][j]);

}
row.push_back(oldValues[i].back());

m_values.push_back(row);
}

else
{
std::vector<std::string> row;
for (size_t j = 0; j < oldHeaders.size(); j++)
{
if (j == column_index)
{
row.push_back(column[i]);
continue;
}
row.push_back("");
}
row.push_back("");

m_values.push_back(row);
}
}
row.push_back(oldValues[i].back());
}

m_values.push_back(row);
else
{
for (size_t i = 0; i < oldValues.size(); i++)
{
std::vector<std::string> row;
for (size_t j = 0; j < oldHeaders.size(); j++)
{
if (j == column_index)
{
if (i >= column.size())
row.emplace_back("");
else
row.push_back(column[i]);
continue;
}

if (j > column_index)
row.push_back(oldValues[i][j - 1]);

else
row.push_back(oldValues[i][j]);

}
row.push_back(oldValues[i].back());

m_values.push_back(row);
}
}

updateHashValues();
Expand Down Expand Up @@ -249,7 +321,7 @@ namespace Marvel {
return;
}

auto oldValues = m_hashValues;
auto oldValues = m_values;

m_values.clear();

Expand Down
Loading

0 comments on commit 9f5ae10

Please sign in to comment.