Skip to content

pfCharts: Component Conversion #384

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

Merged
merged 15 commits into from
Jan 3, 2017

Conversation

dtaylor113
Copy link
Member

@dtaylor113 dtaylor113 commented Jan 2, 2017

Updated the following charts:

  • pfC3Chart
  • pfDonutPctChart
  • pfLineChart
  • pfSparklineChart
  • pfHeatMap
  • pfHeatmapLegend
  • pfTrendsChart
  • pfUtilizationBarChart
  • pfUtilizationTrendChart
  • pfEmptyChart

Only issue was that pfHeatMap still uses the following to compile it's tooltips:

      //Compiles the tooltips
      angular.forEach(angular.element(blocks), function (block) {
        var el = angular.element(block);
        // TODO: get heatmap tooltips to work without using $compile or $scope
        $compile(el)($scope);
      });

Will address in a follow up story: PTNFLY-2068

Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, a few issues found.

I'd like to see the colors and possibly thresholds in the heat map and in some of the tests use patternfly settings but that should likely be addressed elsewhere.

@@ -64,6 +64,7 @@
}

$scope.submitform = function (val) {
console.log("submitform");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove console.log

chartData = ctrl.config;
if (chartData) {
chartData.bindto = '#' + ctrl.id;
$log.info(" -> C3 chart generatd: " + chartData.bindto);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to $log this?

};
angular.module('patternfly.charts').component('pfC3Chart', {
bindings: {
id: '@?',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to bind to id or can we just inject $attrs and get it from there?

items.push({
text: ctrl.legend[index],
color: ctrl.legendColors[index]
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe legendItems would need to be updated if ctrl.legend changes. Looks like an existing issue.

<div ng-if="!loadingDone" class="spinner spinner-lg loading"></div>
<div ng-if="showLegend" pf-heatmap-legend legend="legendLabels" legend-colors="heatmapColorPattern"></div>
<pf-empty-chart ng-if="$ctrl.chartDataAvailable === false" chart-height="$ctrl.height"></pf-empty-chart>
<!--div ng-if="!$ctrl.loadingDone" class="spinner spinner-lg loading"></div-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover comment?

</div>
<div class="trend-flat-details-cell">
<span class="trend-label-flat-strong-pf">{{config.trendLabel}}</span>
<span class="trend-label-flat-pf">{{getLatestValue()}} of {{chartData.total + ' ' + config.units}}</span>
<span class="trend-label-flat-strong-pf">{{$ctrl.nfig.trendLabel}}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be $ctrl.config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, great catch!

</div>
<div>
<span> of {{chartData.total}} {{config.units}}</span>
<span> of {{$ctrl.hartData.total}} {{$ctrl.config.units}}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be $ctrl.chartData

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, another great catch, thanks!

@dtaylor113
Copy link
Member Author

Hi @jeff-phillips-18 ,
Thanks for the review. Last commit addresses all review issues.

  • Dave

Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dgutride dgutride merged commit 4f9cabd into patternfly:branch-4.0-dev Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants